xcode - iOS 9 : SecItemCopyMatching returns successful status code but key is nil -


i trying import private key keychain usingsecitemadd method returns osstatus 0 when try retrieve key key chain using secitemcopymatch, returns nil data osstatus 0 means success

please refer apple developer forum link

the bug occurs due malformed public key refer https://forums.developer.apple.com/thread/15129

if use basic encoding rules library here's solution.

to fix public key need insert nil byte before modulus data. https://github.com/stcredzero/scz-basicencodingrules-ios/issues/6#issuecomment-136601437

p.s. me fix simple as:

const char fixbyte = 0; nsmutabledata * fixedmodule = [nsmutabledata datawithbytes:&fixbyte length:1]; [fixedmodule appenddata:modulusdata]; 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -