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

iphone6 iOS10.1.1 加密失败 #33

Open Feng-xp opened 7 years ago

Feng-xp commented 7 years ago

iphone6 iOS10.1.1,有时会出现加密失败的情况,错误代码为:SecItemCopyMatching((__bridge CFDictionaryRef)publicKey, (CFTypeRef *)&keyRef); 调用,返回的status 是-25300, 这个问题不是必现,手机放个几个小时,然后第一次build的时候想对比较容易出现,连续build的话后面就很难重现。

Feng-xp commented 7 years ago

我有2点不理解: 1.为什么每次都要先删除旧的,在添加一个新的(是否因为不同的publicKey在keychains中生存的证书Tag是一致的) 2.现在问题偶尔出现在SecItemCopyMatching这一步,但是 SecItemAdd 的时候是成功的,那是否可以直接使用SecItemAdd 返回的结果。

peterHchina commented 6 years ago

这个问题我也发现了,你解决了么?

IronMan-I commented 5 years ago

加密失败的概率还是挺高的