ideawu / Objective-C-RSA

Doing RSA encryption and decryption with Objective-C on iOS
http://www.ideawu.com/blog/post/132.html
Other
1.15k stars 280 forks source link

应用在锁屏的时候解密失败,返回nil #48

Closed Ivanjustme closed 6 years ago

Ivanjustme commented 6 years ago
SecKeyRef keyRef = [self addPrivateKey:privKey];

锁屏的时候这行代码不执行,解密就返回nil

Ivanjustme commented 6 years ago

OSStatus status = -25308

Ivanjustme commented 6 years ago

解决方案,就是在获取status状态前加上 [privateKey setObject:(bridge id)kSecAttrAccessibleAfterFirstUnlock forKey:(bridge id)kSecAttrAccessible];