Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问 为什么解密时需要 把公钥存储到keychain? #57

Open
wgywgy opened this issue Mar 28, 2022 · 2 comments
Open

请问 为什么解密时需要 把公钥存储到keychain? #57

wgywgy opened this issue Mar 28, 2022 · 2 comments

Comments

@wgywgy
Copy link

wgywgy commented Mar 28, 2022

  • (SecKeyRef)addPublicKey:(NSString *)key 时为什么不能直接构造 SecKeyRef?存储到keychain的目的是什么?
@wgywgy
Copy link
Author

wgywgy commented Mar 30, 2022

看起来只是为了生成 SecKeyRef,用了keychain的api

@midmirror
Copy link

midmirror commented May 9, 2022

iOS 10+ 可以直接使用 SecKeyCreateWithData 构造 SecKeyRef。(推荐这么做)

使用 SecItemAdd 和 SecItemCopyMatching ,需要访问钥匙串,如果钥匙串不可访问,还会导致 errSecInteractionNotAllowed(-25308)等问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants