• Register

How to create pfx-file from pem-file (with signed certificate) and private key ?

+1 vote

I have signed certificate stored in cert.pem file. Also I have private key stored in iPhoneMyBase64PrivateKey.pem. Then I can use the fillowing openSSL comand:

$openssl pkcs12 -export -out certificate.pfx -inkey iPhoneMyBase64PrivateKey.pem -in cert.pem

to create certificate.pfx, that could be properly installed into iPhone system security stoarage as Security Profile.

How to create this pfx file from cert and privatekey without openSSL ? because I need to create it programmatycally on iPhone.

I already familiar with ASN.1, I've already read different pdf's at rsa laboratories and etc. But there are a lot of different options, and I can not understand what parts should be encrypted, with what keys, what parts should be signed and so on.

So, is it possible to find somewhere somekind of step-by-step guide:

1) Encypt signed cert with public key

2) Create key safebag


...) add octet string with BER encoding


...) Concatenate all data in SEQUENCE

and so on


Any information will be the great help: comments, links and so on.
asked Dec 16, 2011 in SSL Certificates by anonymous

1 Answer

0 votes
In general, however, you should use the CFNetwork API for secure networking and the Certificate, Key, and Trust Services API for cryptographic services. Alternatively, in OS X, you can use the Secure Transport API.

Here is a link to the documentation for the Certificate, Key, and Trust Services API.

answered Aug 26, 2014 by WannaBeGeekster (1,700 points)

Related questions

0 votes
0 answers 318 views
318 views asked Jan 11, 2017 in Programming by kmk_sreenu (120 points)
+1 vote
1 answer 9,740 views
0 votes
1 answer 9,163 views
9,163 views asked Apr 17, 2012 in SSL Certificates by anonymous
+1 vote
1 answer 237 views
237 views asked Jul 7, 2014 in SSL Certificates by anonymous
+1 vote
2 answers 559 views