{"action":"created","issue":{"url":"https://api.github.com/repos/TakeScoop/SwiftyRSA/issues/17","repository_url":"https://api.github.com/repos/TakeScoop/SwiftyRSA","labels_url":"https://api.github.com/repos/TakeScoop/SwiftyRSA/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/TakeScoop/SwiftyRSA/issues/17/comments","events_url":"https://api.github.com/repos/TakeScoop/SwiftyRSA/issues/17/events","html_url":"https://github.com/TakeScoop/SwiftyRSA/issues/17","id":158915212,"number":17,"title":"How to extract publickey from a .cer file?","user":{"login":"hdoria","id":73786,"avatar_url":"https://avatars.githubusercontent.com/u/73786?v=3","gravatar_id":"","url":"https://api.github.com/users/hdoria","html_url":"https://github.com/hdoria","followers_url":"https://api.github.com/users/hdoria/followers","following_url":"https://api.github.com/users/hdoria/following{/other_user}","gists_url":"https://api.github.com/users/hdoria/gists{/gist_id}","starred_url":"https://api.github.com/users/hdoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdoria/subscriptions","organizations_url":"https://api.github.com/users/hdoria/orgs","repos_url":"https://api.github.com/users/hdoria/repos","events_url":"https://api.github.com/users/hdoria/events{/privacy}","received_events_url":"https://api.github.com/users/hdoria/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-07T12:52:43Z","updated_at":"2016-06-08T11:15:10Z","closed_at":null,"body":"I have a .cer file on my bundle.\r\n\r\n```obj-c\r\nNSString *pass = [SwiftyRSA encryptString:password publicKeyDER:publicKeyData padding:kSecPaddingPKCS1 error:nil];\r\n```\r\nHow to extract the publicKey from a .cer file and use it?  "},"comment":{"url":"https://api.github.com/repos/TakeScoop/SwiftyRSA/issues/comments/224559640","html_url":"https://github.com/TakeScoop/SwiftyRSA/issues/17#issuecomment-224559640","issue_url":"https://api.github.com/repos/TakeScoop/SwiftyRSA/issues/17","id":224559640,"user":{"login":"hdoria","id":73786,"avatar_url":"https://avatars.githubusercontent.com/u/73786?v=3","gravatar_id":"","url":"https://api.github.com/users/hdoria","html_url":"https://github.com/hdoria","followers_url":"https://api.github.com/users/hdoria/followers","following_url":"https://api.github.com/users/hdoria/following{/other_user}","gists_url":"https://api.github.com/users/hdoria/gists{/gist_id}","starred_url":"https://api.github.com/users/hdoria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdoria/subscriptions","organizations_url":"https://api.github.com/users/hdoria/orgs","repos_url":"https://api.github.com/users/hdoria/repos","events_url":"https://api.github.com/users/hdoria/events{/privacy}","received_events_url":"https://api.github.com/users/hdoria/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T11:15:10Z","updated_at":"2016-06-08T11:15:10Z","body":"This is what I'm trying to do, but it's not working:\r\n\r\n```objective-c\r\nNSBundle *bundle = [NSBundle bundleForClass:self.class];\r\nNSString *pubPath = [bundle pathForResource:@\"myCertificate\" ofType:@\"cer\"];\r\nNSData *publicKeyData = [NSData dataWithContentsOfFile:pubPath];\r\nNSString *password = [SwiftyRSA encryptString:@\"123456\" publicKeyDER:publicKeyData padding:kSecPaddingPKCS1 error:nil];\r\n```\r\n\r\nThe app crash with EXC_BAD_ACCESS when calling the encryptString method.\r\n\r\nThere's a myCertificate.cer file on my bundle."}}
{"actor":{"display_login":"hdoria"}}