在Objective-C中使用NSLog打印SecKeyRef引用

时间:2015-03-26 18:14:24

标签: ios objective-c iphone security

我正在使用以下代码从证书中检索公钥。

- (SecKeyRef) extractPublicKeyFromCertificate: (SecIdentityRef) identity {
    // Get the certificate from the identity.
    SecCertificateRef myReturnedCertificate = NULL;
    OSStatus status = SecIdentityCopyCertificate (identity,
                                              &myReturnedCertificate);

    if (status) {
        NSLog(@"SecIdentityCopyCertificate failed.\n");
        return NULL;
    }

    SecKeyRef publickey;

    SecCertificateCopyPublicKey(myReturnedCertificate, &publickey);
    NSLog(@"%@", publickey);   

    return publickey;
}

我正在尝试打印"公钥"变量来查看内容。我收到运行时错误。我想知道如何打印" publickey"的内容。变量?

0 个答案:

没有答案