Tuesday, July 28, 2009

read PKCS #12 format file by openssl


Oracle Wallet Manager stores X.509 certificates and private keys in industry-standard, PKCS #12 format.

If need to read private key and certificates from file (PKCS #12 format):

that can use openssl to help(have to know "wallet password"):

Read from file (PKCS #12 format) to standard out:
$ openssl pkcs12 -in ewallet.p12
Enter Import Password:
MAC verified OK
.
.

If need to write to file standard:
$ openssl pkcs12 -in ewallet.p12 -out file.out
Enter Import Password:
MAC verified OK

If reading private key from file (PKCS #12 format), we need to type "pass phrase" (phrase is too short, needs to be at least 4 chars):
$ openssl pkcs12 -in ewallet.p12 -out file.out
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
Warning unsupported bag type: secretBag
.
.

No comments: