我正在使用以下代码从证书中检索公钥。
- (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"的内容。变量?