Languages
[Edit]
EN

Bash - read *.p12 keystore info

3 points
Created by:
Shri
8550

In this short article, we would like to show how to read information about *.p12 keystore file using openssl command.

Quick solution:

openssl pkcs12 -info -in /path/to/keystore_file.p12

 

Practical example

Run the following command:

openssl pkcs12 -info -in /path/to/keystore_file.p12

Where: /path/to/keystore_file.p12 should be changed into keystore file that we want to read.

Note: it is necessary to type password to read file (do it after Enter Import Password: message appeard).

Example output:

Enter Import Password:
MAC: sha1, Iteration 2048
MAC length: 20, salt length: 8
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048
Certificate bag
Bag Attributes
    localKeyID: 45 12 22 14 8A F0 84 1F 9B FD 0A F4 B7 36 42 48 29 B3 7B 8E
subject=O = "CloudFlare, Inc.", OU = CloudFlare Origin CA, CN = CloudFlare Origin Certificate

issuer=C = US, O = "CloudFlare, Inc.", OU = CloudFlare Origin SSL Certificate Authority, L = San Francisco, ST = California

-----BEGIN CERTIFICATE-----
MIIEoDCCA4m9rA3Xr7ISvGhawOYO4wDQYJKoZIigAwIBAgIURCoe1iJ3hvcNAQEL
BQAwgYsxCzAJBgNVBAYTAlVTMRkwFwYDVQQKExBDbG91ZEZsYXJlLCBJbmMuMTQw
MgYDVQQLE2VydGlmaWNhdGUgQXVytDbG91ZEZsYXJlIE9yaWdpbiBTU0wgQ0aG9y
...
m6uDTG1iDPRzRpwlhyLG3xxV5Bm4rdb0a6lQyrMuG/WHGBlMVaw3csfM5KHrVwz/
W9nvxbAJfjIUNttPfJyZM+5l9lCMgOIhr2jhjRepgfyT2cljeab1Gn5dHocuG/Ig
MAwGCCqGSIb3DQIJBQAwFAYIKoZIhvcNAwcECCsEIHead7OfBIIEyAESSwbs4mXU
9Vb3OehP7nSjyPrgb6jHM8w8CWnB06wuDAyZwGaWYe6JHDLJ
-----END CERTIFICATE-----
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 2048
Bag Attributes
    localKeyID: 45 12 22 14 8A F0 84 1F 9B FD 0A F4 B7 36 42 48 29 B3 7B 8E
Key Attributes: <No Attributes>
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIFHDBOBgkqhkiG9w0BBQ0wQTApBgkqhkiG9w0BBQwwHAQIDwd95onkExYCAggA
kzl1Xx59Fm+84ByxwMz7JwLFy/LI5hvhTK85Id+Uff1lVAL+K6hAPGRJgPP0XCse
y2+butmmB1wDrTb7UMHqX6yCe4ODZARZmH7lEE0KK8DUF0duev9e8jGupFeX7x82
...
pWNvFzbRizAMv5bjP0YOL3yxpnIPDPrpyVD0wCpj/DEWEIB9nxyTdvbrH5crRitJ
41teOi4X9IyqQuB9YobIAkeeuwEtsUkcJ9Gm7x7Csi7oVeV+PFc2cKPbJcBQLixE
aXRNvMRMwEQYDVQQIEwpDYWxpZm9yb5MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2mlh
E2565aVqP7g5gL9F/xXP/A==
-----END ENCRYPTED PRIVATE KEY-----

 

Alternative titles

  1. Bash - read pkcs12 keystore file format
  2. Bash - print pkcs12 certificate
  3. Bash - print *.p12 certificate
  4. Linux - view *.p12 file
  5. Linux - show *.p12 file contents
  6. Linux - read *.p12 certificate
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - read *.p12 keystore info
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join