【发布时间】:2010-10-25 05:42:12
【问题描述】:
现在我有一个包含公钥的证书,我想在 iPhone SDK 编程中从中获取公钥,并使用公钥通过 RSA 加密字符串。我该怎么办?
【问题讨论】:
标签: iphone encryption rsa
现在我有一个包含公钥的证书,我想在 iPhone SDK 编程中从中获取公钥,并使用公钥通过 RSA 加密字符串。我该怎么办?
【问题讨论】:
标签: iphone encryption rsa
SecKeyRef publicKeyReference = NULL;
NSMutableDictionary* queryPublicKey;
SecItemCopyMatching((CFDictionaryRef)queryPublicKey, (CFTypeRef *)&publicKeyReference);
publicKeyReference - 是您的公钥表示; queryPublicKey - 是您的证书表示; SecItemCopyMatching - 允许您从证书中检索公钥的函数!
【讨论】: