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
Post a Comment