21

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

3
  • 3
    I found that using weak password worked (lowercase letters), however using a strong password (uppercase letters, numbers and punctuation) did not (this is not a solution).
    – paulvs
    Commented Feb 16, 2016 at 14:42
  • Maybe duplicate of: stackoverflow.com/questions/19229386/… Commented Mar 23, 2022 at 9:12
  • Feel free to flag an answer as your solution Commented Apr 16 at 7:22

2 Answers 2

26

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>
1
  • When using the CLI in windows I had to prepend the command with winpty and having the password specified as above allowed me to proceed while trying to enter the prompt when not specifying the -password resulted in the Mac verify error Commented May 4, 2018 at 17:59
5

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:

And if you remembered that there is a password, good for you! Use that:

openssl pkcs12 -in input.p12 -out output.pem -nodes -passin pass:"YOUR PASSWORD"

Source:

https://stackoverflow.com/a/71584593/3451846


Note: if there is a password but you can't remember it, contact the author of that file and get the password.

If you really cannot remember the password, you have a problem. That problem cannot be solved by you, or by StackOverflow. Unless you have a bruteforce power using a quantum computer or something alien like that.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.