canAuthenticateAgainstProtectionSpace
我被要求根据(的委托回调NSURLConnection
)中的已知值检查公钥
这是我到目前为止所拥有的:
- (BOOL)connection:(NSURLConnection *)connection
canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
{
SecKeyRef publicKey = SecTrustCopyPublicKey([protectionSpace serverTrust]);
NSLog(@"%@",SecTrustCopyPublicKey([protectionSpace serverTrust]));
return YES;
}
如何将公钥与已知值进行比较?
NSLog 产生:<SecKeyRef: 0x687c000>
这没什么用。