{"action":"created","issue":{"url":"https://api.github.com/repos/jstedfast/MimeKit/issues/220","labels_url":"https://api.github.com/repos/jstedfast/MimeKit/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/jstedfast/MimeKit/issues/220/comments","events_url":"https://api.github.com/repos/jstedfast/MimeKit/issues/220/events","html_url":"https://github.com/jstedfast/MimeKit/issues/220","id":127774696,"number":220,"title":"Howto import keys into GnuPGContext using ImportSecretKeys?","user":{"login":"polterguy","id":8466933,"avatar_url":"https://avatars.githubusercontent.com/u/8466933?v=3","gravatar_id":"","url":"https://api.github.com/users/polterguy","html_url":"https://github.com/polterguy","followers_url":"https://api.github.com/users/polterguy/followers","following_url":"https://api.github.com/users/polterguy/following{/other_user}","gists_url":"https://api.github.com/users/polterguy/gists{/gist_id}","starred_url":"https://api.github.com/users/polterguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polterguy/subscriptions","organizations_url":"https://api.github.com/users/polterguy/orgs","repos_url":"https://api.github.com/users/polterguy/repos","events_url":"https://api.github.com/users/polterguy/events{/privacy}","received_events_url":"https://api.github.com/users/polterguy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jstedfast/MimeKit/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-20T20:16:48Z","updated_at":"2016-01-21T12:46:46Z","closed_at":"2016-01-20T22:41:04Z","body":"Howdy, I'm fiddling around with trying to create a key pair using BouncyCastle, and figured I'd use the ImportSecretKeys method on OpenPGPContext to import my keys, but it doesn't work. It doesn't throw an error or anything, but when I check out my keys in GPG Keychain (MAC OS X), the keys don't show up ...?\r\n\r\nHere is my code ...\r\n```csharp\r\n// Creating our keypair\r\nIAsymmetricCipherKeyPairGenerator kpg = new RsaKeyPairGenerator ();\r\nkpg.Init (new RsaKeyGenerationParameters (BigInteger.ValueOf(0x13), new SecureRandom (), 1024, 8));\r\nAsymmetricCipherKeyPair kp = kpg.GenerateKeyPair();\r\n\r\n// Importing keypair to GnuPG\r\nusing (var ctx = new GnuPrivacyContext ()) {\r\n\r\n    // Serializing key(s) to MemoryStream\r\n    using (var memStreamPrivate = new MemoryStream ()) {\r\n        PgpSecretKey secretKey = new PgpSecretKey (\r\n            PgpSignature.DefaultCertification,\r\n            PublicKeyAlgorithmTag.RsaGeneral,\r\n            kp.Public,\r\n            kp.Private,\r\n            DateTime.Now,\r\n            \"foo@bar.com\",\r\n            SymmetricKeyAlgorithmTag.Cast5,\r\n            \"password\".ToCharArray (),\r\n            null,\r\n            null,\r\n            new SecureRandom());\r\n        secretKey.Encode (memStreamPrivate);\r\n        ctx.ImportSecretKeys (memStreamPrivate);\r\n    }\r\n}\r\n\r\n```\r\n\r\nIs there something I have misunderstood ...? (which I assume btw)\r\n\r\nBasically, what I am trying to achieve, is to create a private/public OpenPGP keypair, and import it into my Keychain ..."},"comment":{"url":"https://api.github.com/repos/jstedfast/MimeKit/issues/comments/173559820","html_url":"https://github.com/jstedfast/MimeKit/issues/220#issuecomment-173559820","issue_url":"https://api.github.com/repos/jstedfast/MimeKit/issues/220","id":173559820,"user":{"login":"jstedfast","id":338984,"avatar_url":"https://avatars.githubusercontent.com/u/338984?v=3","gravatar_id":"","url":"https://api.github.com/users/jstedfast","html_url":"https://github.com/jstedfast","followers_url":"https://api.github.com/users/jstedfast/followers","following_url":"https://api.github.com/users/jstedfast/following{/other_user}","gists_url":"https://api.github.com/users/jstedfast/gists{/gist_id}","starred_url":"https://api.github.com/users/jstedfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstedfast/subscriptions","organizations_url":"https://api.github.com/users/jstedfast/orgs","repos_url":"https://api.github.com/users/jstedfast/repos","events_url":"https://api.github.com/users/jstedfast/events{/privacy}","received_events_url":"https://api.github.com/users/jstedfast/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T12:46:46Z","updated_at":"2016-01-21T12:46:46Z","body":"Hmmm, that should have worked... I'll look more today."}}