【问题标题】:How to get public key from a certificate in iPhone program?如何从 iPhone 程序中的证书中获取公钥?
【发布时间】:2010-10-25 05:42:12
【问题描述】:

现在我有一个包含公钥的证书,我想在 iPhone SDK 编程中从中获取公钥,并使用公钥通过 RSA 加密字符串。我该怎么办?

【问题讨论】:

    标签: iphone encryption rsa


    【解决方案1】:
    SecKeyRef publicKeyReference = NULL;
    NSMutableDictionary* queryPublicKey;
    
    SecItemCopyMatching((CFDictionaryRef)queryPublicKey, (CFTypeRef *)&publicKeyReference);
    

    publicKeyReference - 是您的公钥表示; queryPublicKey - 是您的证书表示; SecItemCopyMatching - 允许您从证书中检索公钥的函数!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-07
      • 1970-01-01
      • 1970-01-01
      • 2012-12-22
      • 2016-11-03
      相关资源
      最近更新 更多