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

OSX 支持不能 #11

Closed remaerd closed 5 years ago

remaerd commented 8 years ago

Hi,

我最近在用 Swift 写一个类似的 RSA Public Key 的 Framework。比较奇怪的是 iOS 没问题,但 OSX 却卡在了 SecItemAdd 上了。

我用你的 Objective-C 代码简单弄了一个 OSX Framework,也是卡在同一个地方。无法通过 SecItemAdd 添加 Public Key,返回错误 -25303。应该是不能在 CFDictionary 里面包含 kSecAttrKeyClassPublic。如果删掉这个函数,Keychain Access 会弄一个 Symmetric Key 在里面,但是肯定是出错了,现在都无法通过 Keychain Access 删掉这个错误的 Key。

网上找了一下,都是关于 iOS 的,没有 OSX 的,你觉得有没有解决办法呢?

感谢!

ideawu commented 8 years ago

抱歉, 我也没试过 OS X 的.

wxq491216 commented 5 years ago

碰到了一样的问题,还没找到解决方法!

remaerd commented 5 years ago

三年才有回复… 我好像已经解决问题了。我用的 Swift 写的框架 remaerd/Keys 好像已经解决这个问题了。具体解决办法忘了,但 macOS 应该是要用不一样的 API 重新实现。你可以参考一下。