I keep getting this error:
Mac verify error: invalid password?
For these two commands:
openssl pkcs12 -nocerts -out PushKey.pem -in moo.p12
openssl pkcs12 -nocerts -out PushKey.pem -in moo.p12 -nodes
moo.p12 is issued by apple for push notifications
openssl pkcs12 -in path.p12 -out newfile.crt.pem -clcerts -nokeys openssl pkcs12 -in path.p12 -out newfile.key.pem -nocerts -nodes To put the certificate and key in the same file use the following If you need to input the PKCS#12 password directly from the command line (e.g. a script), just add -passin pass:$ {PASSWORD}:
Already on GitHub? Sign in to your account If you have a PKCS#12 file which is not protected with a password, and which does not have a MAC entry, opening the file will work on Windows but fails on Linux and Mac (which use OpenSSL). The following program reproduces the behavior:
Based on RFC7292, I believe that's valid, and BouncyCastle creates PKCS#12 files without MAC entries if no password is provided. This file was created by Bouncy Castle, which emits the MAC entry if it is not password protected The file loads correctly using OpenSSL if you specify the -nomacver flag
Our P12 file can contain a maximum of 10 intermediate certificates. To dump all of the information in a PKCS#12 file in PEM format, use this command: nodes: generates a new private key without using a passphrase (-nodes)
You should have a password that come with the pfx file.
Try to put the password in the command line like this. Then you'll get both the private key and certificate in pem format:
openssl pkcs12 -nocerts -out PushKey.pem -in moo.p12 -nodes -password pass:<mypassword>
Note: as already said, you should have a password that come with the pfx file.
In case they have not shared with you any password, maybe the password is just an empty one. In this case, try with -passin pass:
to express an empty password.
Example:
openssl pkcs12 -in input.p12 -out output.pem -nodes -passin pass:
Source:
https://stackoverflow.com/a/71584593/3451846
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With