I have installed openssl and keytool and set the path variables too.
I want to generate the PKCS12 file from primary key and certificate files(.pem files) and then convert that into a JKS file.
When I run a command in the openssl
program pkcs12 -export -in certificate.pem -inkey privateKey.pem -certfile certificate.pem -out testkeystore.p12
I get following message-
unable to load private key
28616:error:0D0E20DE:asn1 encoding routines:c2i_ibuf:illegal zero content:crypto\asn1\a_int.c:154:
28616:error:0D08303A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1 error:crypto\asn1\tasn_dec.c:646:Field=version, Type=PKCS8_PRIV_KEY_INFO
28616:error:0907B00D:PEM routines:PEM_read_bio_PrivateKey:ASN1 lib:crypto\pem\pem_pkey.c:88:
What is going wrong here?
I have stored the both .pem files at C:\CertFiles The path variable is also set to - C:\Program Files\OpenSSL-Win64\bin Please see image below- enter image description here