¡@

Home 

2014/10/15 ¤U¤È 10:13:41

iphone Programming Glossary: seccertificateref

get pfx file included in a mobilecertificate in iOS

http://stackoverflow.com/questions/11718305/get-pfx-file-included-in-a-mobilecertificate-in-ios

SecIdentityRef myIdentity SecTrustRef myTrust OSStatus status extractIdentityAndTrust inpfxdata myIdentity myTrust SecCertificateRef myCertificate SecIdentityCopyCertificate myIdentity myCertificate const void certs myCertificate CFArrayRef certsArray CFArrayCreate..

How to verify a website certificate in Cocoa Touch?

http://stackoverflow.com/questions/1251117/how-to-verify-a-website-certificate-in-cocoa-touch

NSArray CFReadStreamCopyProperty readStream kCFStreamPropertySSLPeerCertificates autorelease if certificates count 0 SecCertificateRef certificate SecCertificateRef certificates objectAtIndex 0 NSString description NSString SecCertificateCopySubjectSummary.. readStream kCFStreamPropertySSLPeerCertificates autorelease if certificates count 0 SecCertificateRef certificate SecCertificateRef certificates objectAtIndex 0 NSString description NSString SecCertificateCopySubjectSummary certificate autorelease NSData..

iPhone: HTTPS client cert authentication

http://stackoverflow.com/questions/1460626/iphone-https-client-cert-authentication

@ certificate ofType @ cer NSData certData NSData alloc initWithContentsOfFile certPath SecIdentityRef myIdentity SecCertificateRef myCert SecCertificateCreateWithData NULL CFDataRef certData certData release SecCertificateRef certArray 1 myCert CFArrayRef.. myIdentity SecCertificateRef myCert SecCertificateCreateWithData NULL CFDataRef certData certData release SecCertificateRef certArray 1 myCert CFArrayRef myCerts CFArrayCreate NULL void certArray 1 NULL CFRelease myCert NSURLCredential credential.. from the pkcs12 certificate file using SecPKCS12Import function use SecIdentityCopyCertificate function to get SecCertificateRef and the rest a credential initialization is the same as in my question... I can put here more code if you want. Note that..

iPhone: How to create a SecKeyRef from a public key file (PEM)

http://stackoverflow.com/questions/1595013/iphone-how-to-create-a-seckeyref-from-a-public-key-file-pem

pem and get a cert using SecCertificateCreateWithData from which you can then extract a key NSData myCertData .... SecCertificateRef cert SecCertificateCreateWithData kCFAllocatorDefault myCertData CFArrayRef certs CFArrayCreate kCFAllocatorDefault const..

Importing an SSL cert under the iPhone SDK

http://stackoverflow.com/questions/1746005/importing-an-ssl-cert-under-the-iphone-sdk

fetching but not the current iPhone OS. Here's the gist of the actual code OSStatus err NSString path NSData data SecCertificateRef cert path NSBundle mainBundle pathForResource @ OFX G3 ofType @ cer assert path nil data NSData dataWithContentsOfFile path..

NSURLCredentialStorage and client certificate authentication

http://stackoverflow.com/questions/4164846/nsurlcredentialstorage-and-client-certificate-authentication

CFDataRef PKCS12Data SecIdentityRef identity SecTrustRef trust extractIdentityAndTrust inPKCS12Data identity trust SecCertificateRef certificate NULL SecIdentityCopyCertificate identity certificate const void certs certificate CFArrayRef certArray CFArrayCreate..

send RSA public key to iphone and use it to encrypt

http://stackoverflow.com/questions/4211484/send-rsa-public-key-to-iphone-and-use-it-to-encrypt

from dataWithContentsOfFile for example NSData encryptString NSString plainText withX509Certificate NSData certificate SecCertificateRef cert SecCertificateCreateWithData kCFAllocatorDefault __bridge CFDataRef certificate SecPolicyRef policy SecPolicyCreateBasicX509..

Does SecTrustEvaluate() look for root certificates in the application keychain?

http://stackoverflow.com/questions/4669255/does-sectrustevaluate-look-for-root-certificates-in-the-application-keychain

path NSBundle mainBundle pathForResource @ my.cert ofType @ der NSData derData NSData dataWithContentsOfFile path SecCertificateRef myCert SecCertificateCreateWithData NULL CFDataRef derData CFMutableArrayRef array CFArrayCreateMutable NULL 1 NULL CFArrayInsertValueAtIndex.. again better choices needed abort CFIndex cnt CFArrayGetCount certs loop and compare 'em for int i 0 i cnt i SecCertificateRef cert SecTrustGetCertificateAtIndex trust i CFDataRef cdata SecCertificateCopyData cert NSData data NSData alloc initWithData..