Skip to content
This repository has been archived by the owner on Nov 19, 2018. It is now read-only.

RSA Private Key given PKCS12 File Extension #34

Open
doapp-nick opened this issue Sep 2, 2015 · 3 comments
Open

RSA Private Key given PKCS12 File Extension #34

doapp-nick opened this issue Sep 2, 2015 · 3 comments
Labels

Comments

@doapp-nick
Copy link

I spent a few hours debugging an issue related to the generation of new signing identities using cert. Specifically, after a successful creation 3 new files are generated.

  • CertCertificateSigningRequest.certSigningRequest
  • XXXXXXXXX.cer
  • private_key.p12

The private_key.p12 does not appear to be a p12 (PKCS12) but a RSA Private Key. PKCS12, as a packaging format, when exported from Keychain Access tends to be a combination of the private key and the certificate generated by the CSR in PEM format.

The easiest fix here is probably to change the file extension to something more consistent with what is contained, say '.rsa'. A more complete fix might be to generate a p12 from the cert and the rsa private key in the same fashion that Keychain Access does.

@cwhenderson20
Copy link

👍 for this. Generating a valid .p12 would be helpful as it keeps the certificate and private key bundled. By convention, though, .p12 files require a non-blank passphrase, which might be an issue for those who don't want to specify it on import/export.

@RocketPop
Copy link

I think this is how you can whip up a p12 from a pem
openssl pkcs12 -export -in certfilename.pem -out certfilename.p12 -passout pass:xxxxxxx

Where you need to provide a passphrase instead of "xxxx..." Also - please double check this snippet before actually using it :)

@marcomorain
Copy link

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants