{"action":"created","issue":{"url":"https://api.github.com/repos/AArnott/PCLCrypto/issues/29","labels_url":"https://api.github.com/repos/AArnott/PCLCrypto/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/AArnott/PCLCrypto/issues/29/comments","events_url":"https://api.github.com/repos/AArnott/PCLCrypto/issues/29/events","html_url":"https://github.com/AArnott/PCLCrypto/issues/29","id":99210848,"number":29,"title":"Import of RSA key crashes on iOS9","user":{"login":"dsizomin","id":746587,"avatar_url":"https://avatars.githubusercontent.com/u/746587?v=3","gravatar_id":"","url":"https://api.github.com/users/dsizomin","html_url":"https://github.com/dsizomin","followers_url":"https://api.github.com/users/dsizomin/followers","following_url":"https://api.github.com/users/dsizomin/following{/other_user}","gists_url":"https://api.github.com/users/dsizomin/gists{/gist_id}","starred_url":"https://api.github.com/users/dsizomin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsizomin/subscriptions","organizations_url":"https://api.github.com/users/dsizomin/orgs","repos_url":"https://api.github.com/users/dsizomin/repos","events_url":"https://api.github.com/users/dsizomin/events{/privacy}","received_events_url":"https://api.github.com/users/dsizomin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/AArnott/PCLCrypto/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/AArnott/PCLCrypto/labels/up%20for%20grabs","name":"up for grabs","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-08-05T14:00:00Z","updated_at":"2015-10-29T16:52:22Z","closed_at":null,"body":"Hi,\r\n\r\nI'm using PCLCrypto to verify RSA signature on Android/iOS.\r\nAfter tests in iOS9 Beta it appeared that importing public key is not working on iOS9. The exact result is InvalidOperationException \"SecItemAdd returns 0\".\r\n\r\nThe strange thing is that return result (OSStatus) is 0, which means \"no error\". However, the reference handle which has to be set by SecItemAdd is 0. Please refer to the code below:\r\n\r\n\t\t\tIAsymmetricKeyAlgorithmProvider algorithmProvider = WinRTCrypto.AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithm.RsaSignPkcs1Sha256);\r\n\r\n\t\t\tICryptographicKey generatedKeyPair = algorithmProvider.CreateKeyPair(2048);\r\n\r\n\t\t\tbyte[] generatedPublicKey = generatedKeyPair.ExportPublicKey(CryptographicPublicKeyBlobType.Pkcs1RsaPublicKey);\r\n\r\n\t\t\tICryptographicKey importedKey = algorithmProvider.ImportPublicKey(generatedPublicKey, CryptographicPublicKeyBlobType.Pkcs1RsaPublicKey); //InvalidOperationException\r\n\r\nAny thoughts or ideas how to overcome this issue?\r\n\r\nThanks in advance!\r\nDenys\r\n"},"comment":{"url":"https://api.github.com/repos/AArnott/PCLCrypto/issues/comments/152246709","html_url":"https://github.com/AArnott/PCLCrypto/issues/29#issuecomment-152246709","issue_url":"https://api.github.com/repos/AArnott/PCLCrypto/issues/29","id":152246709,"user":{"login":"asheffield","id":15363991,"avatar_url":"https://avatars.githubusercontent.com/u/15363991?v=3","gravatar_id":"","url":"https://api.github.com/users/asheffield","html_url":"https://github.com/asheffield","followers_url":"https://api.github.com/users/asheffield/followers","following_url":"https://api.github.com/users/asheffield/following{/other_user}","gists_url":"https://api.github.com/users/asheffield/gists{/gist_id}","starred_url":"https://api.github.com/users/asheffield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asheffield/subscriptions","organizations_url":"https://api.github.com/users/asheffield/orgs","repos_url":"https://api.github.com/users/asheffield/repos","events_url":"https://api.github.com/users/asheffield/events{/privacy}","received_events_url":"https://api.github.com/users/asheffield/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T16:52:22Z","updated_at":"2015-10-29T16:52:22Z","body":"Can you use #if __IOS__   and #endif, then check the version using dependencyservice with - UIDevice.CurrentDevice.CheckSystemVersion(9, 0) \r\nor UIDevice.CurrentDevice.SystemVersion."}}