iphone - How to print the public key of a certificate (Objective-C) -


I have a certificate. P12 and .crt and I have to store the public key to print it and the key iPhone application I have seen the documentation of the iPhone, but I can not do this ...

This is surprisingly easy. You do not need to add a certificate for the keychain to handle this case. Rather, just load the certificate data (i.e., the contents of a .cer file) in your application (you can either get from your bundle or turn off the network) and then underline a certificate using SecCertificateCreateWithData Please. From there you can remove a public key ref by using a SecTrust object (SecTrustCreateWithCertificates, SecTrustEvaluate - you can choose to ignore the resulting SecTrustResultType- and SecTrustCopyPublicKey). And from there you can encrypt and verify using SecKey APIs (SecKeyEncrypt, SecKeyRawVerify).


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -