将RSA密钥导入iPhone钥匙串? [英] Import RSA keys to iPhone keychain?

查看:423
本文介绍了将RSA密钥导入iPhone钥匙串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个NSString对象表示RSA公共 - 私人密钥对(不是由SecKeyCreatePair生成,而是由外部加密库)。如何从这些NSString对象创建SecKeyRef对象(这是SecKeyDecrypt / Encrypt方法所需的)?

I have a couple of NSString objects that represent an RSA public-private keypair (not generated by SecKeyCreatePair, but by an external crypto library). How can I create SecKeyRef objects (which are required for the SecKeyDecrypt/Encrypt methods) from these NSString objects?

我需要先将它们导入Keychain吗?如果是,如何?

Do I need to import them into the Keychain first? If so, how?

谢谢!

推荐答案

用正确的标志集调用 SecItemAdd 。请参阅: http://hg.mozilla .org / services / fx-home / file / tip / Sources / NetworkAndStorage / CryptoUtils.m#l931

The answer was to call SecItemAdd with the right set of flags. See: http://hg.mozilla.org/services/fx-home/file/tip/Sources/NetworkAndStorage/CryptoUtils.m#l931

这篇关于将RSA密钥导入iPhone钥匙串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆