Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem Import Public Key in IOS 10

See original GitHub issue

My App in Xamarin IOS there is this exception during ImportPublicKey:


 at PCLCrypto.RsaAsymmetricKeyAlgorithmProvider.ImportPublicKey (System.Byte[] keyBlob, PCLCrypto.CryptographicPublicKeyBlobType blobType) [0x000b4] in <0d3c0b2586f645d4a87ef50f78aa84f8>:0 

Message: SecItemAdd return -34018

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

gregfiskecommented, Nov 30, 2016

I ran across this, too. Seems to be an Xcode issue at the root. Finally found a simple workaround with Xamarin tooling:

  1. Ensure Entitlements.plist exists in project.
  2. Enter “Entitlements.plist” in iOS Bundle Signing -> Custom Entitlements.

With that I was able to get @leastprivilege’s iOSClient sample running on iOS 10 simulator.

ref: for more about the Xcode problem, see and (search the page for 28338972)

scriptamcommented, Jan 24, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found