FreeKB (2024)

Java - List the certificates in a keystore or truststore using the Java keytool command

FreeKB (1)

If you are not familiar with the Java keytool command, check out our Getting Started article.

TheJava keytool command with the-listoptioncan be used to view certificates in a Java keystore or truststore file.

AVOID TROUBLE

See Also
Support

If the keystore or truststore type is PKCS12, the-storetype pkcs12option must be used.

If the Java keystore or truststore is password protected, you will be prompted for the password.

~]$ keytool -keystore /path/to/keystore.p12 -storetype pkcs12 -listEnter keystore password:

Or, the-storepassoption can be used to provide the password on the command line.

  • PrivateKeyEntrycontains a private key and typically the public certificates that make up the certificate chain (the root certificate authority (CA) certificate, the intermediate certificate authority (CA) certifiate, and the server certificate).
  • trustedCertEntrytypically contains only the root certificate authority (CA) certificate but may contain thepublic certificates that make up the certificate chain (the root certificate authority (CA) certificate, the intermediate certificate authority (CA) certifiate, and the server certificate). A trustedCertEntry does not contain a private key.
~]# keytool -keystore /path/to/keystore.p12 -storetype pkcs12 -list -storepass itsasecretKeystore type: pkcs12Keystore provider: SUNYour keystore contains 3 entriesDigiCert, Aug 21, 2023, trustedCertEntry, Certificate fingerprint (SHA1): 1E:0C:EB:DC:CA:E3:DC:16:76:77:EE:BE:91:9B:43:3D:9D:10:15:8EGoDaddy, Oct 14, 2023, trustedCertEntry, Certificate fingerprint (SHA1): 8A:7B:10:43:A1:BE:78:D0:CF:12:9F:02:8C:99:F2:3D:1A:69:81:1Dexample.com, May 12, 2023, PrivateKeyEntry,Certificate fingerprint (SHA1): D0:80:B9:77:80:F9:DA:FF:77:54:4F:36:B1:A8:03:6F:25:EE:1C:72

The -v (verbose) optioncan be used to display the full details of each trustedCertEntry andPrivateKeyEntry in the keystore.

keytool -keystore /path/to/keystore.p12 -storetype pkcs12 -list -v

Or, the-aliasoption can be used to display the full details of a specifictrustedCertEntry andPrivateKeyEntry in the keystore.

~]# keytool -keystore /path/to/keystore.p12 -storetype pkcs12 -list -v -alias example.comKeystore type: PKCS12Keystore provider: SUNYour keystore contains 1 entryAlias name: example.comCreation date: Feb 10, 2023Entry type: PrivateKeyEntryCertificate chain length: 3Certificate[1]:Owner: CN=www.example.com, OU=Information Technology, O=Acme, L=Appleton, ST=WI, C=USIssuer: CN=IntermediateCA, DC=example, DC=comSerial number: 3a000001d8af30a16a44402b790001000001d8Valid from: Wed Jun 29 14:30:15 UTC 2022 until: Thu Jun 29 14:30:15 UTC 2023Certificate fingerprints: SHA1: D0:80:B9:77:80:F9:DA:FF:77:54:4F:36:B1:A8:03:6F:25:EE:1C:72 SHA256: 14:8C:CD:59:A9:C4:48:45:33:28:C3:AE:E7:6C:B6:1E:0A:F5:3B:9C:64:E5:BB:02:69:30:81:D9:6D:5F:06:ADSignature algorithm name: SHA256withRSASubject Public Key Algorithm: 2048-bit RSA keyVersion: 3

The-rfcflag can be used to return the encoded certificate data.

keytool -keystore /path/to/keystore.p12 -storetype pkcs12 -list -rfc

Did you find this article helpful?

If so, consider buying me a coffee over at FreeKB (2)


FreeKB (2024)
Top Articles
How to Manage Common Stakeholder Issues and Challenges
Motley Fool Epic Review: See Why it is Worth It!
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 5955

Rating: 4.6 / 5 (66 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.