Problem Import Public Key in IOS 10
See original GitHub issueMy App in Xamarin IOS there is this exception during ImportPublicKey:
Stack:
at PCLCrypto.RsaAsymmetricKeyAlgorithmProvider.ImportPublicKey (System.Byte[] keyBlob, PCLCrypto.CryptographicPublicKeyBlobType blobType) [0x000b4] in <0d3c0b2586f645d4a87ef50f78aa84f8>:0
Message: SecItemAdd return -34018
Issue Analytics
- State:
- Created 7 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Importing Cryptographic Keys | Apple Developer Forums
This post explains how to import each type of key. If you're not sure what type of key you have, or how its...
Read more >Issue importing a user's public RSA key into IOS-XR ...
On IOS-XR 6.0, importing a user's RSA base-64 formatted public key seems impossible, whether it a 1024 or 2048 key (the [] show...
Read more >An error has occurred. Unable to import an item. The ...
1., open Keychain Access. 2., On the Keychains panel right click on login. Select Lock Keychain "login". 3., Then unlock it. Then the...
Read more >Importing public key does nothing : r/tails
I have the problem that i can't copy and paste pgp keys anymore into the gnuGPG program. Also it doesen't import .asc or...
Read more >Cannot Import SSH key · Issue #522 · blinksh/blink
Whenever I load the app, go to Keys -> Add -> Import from Clipboard the app, with no error, generates a new key....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran across this, too. Seems to be an Xcode issue at the root. Finally found a simple workaround with Xamarin tooling:
With that I was able to get @leastprivilege’s iOSClient sample running on iOS 10 simulator.
ref: https://bugzilla.xamarin.com/show_bug.cgi?id=44361#c3 for more about the Xcode problem, see https://forums.developer.apple.com/message/179846 and https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html (search the page for 28338972)
Just to supplement @gregfiske’s comment - I was getting the same exception, and the issue was appearing on iOS 10 Simulator.
System.InvalidOperationException: SecItemAdd return -34018 ... at PCLCrypto.RsaAsymmetricKeyAlgorithmProvider.ImportPublicKey
By adding entitlements to iOS Bundle Signing as @gregfiske recommended (yes, even for debug & release and for simulator), the issue was resolved. Just ensure you have corresponding signing identity and provisioning profile for your bundle ID.