According to the openssl PKCS12 documentation, your -back, -inkey and certfile should be in PEM format. Thanks for the powerful answer on Stack Overflow! Be sure to answer the question. Provide details, but also share your research!