[Mac] 使用 keytool 指令檢視 Java JKS 檔案裡的內容
今天拿到一個 Java 在用的 JKS 檔案,
不過平常我不會寫 Java,要怎麼確認這個 JKS 檔案的內容呢?
查了一下,假設有安裝 JDK 或 OpenJDK 的話,
那應該會有 keytool
這個工具可以用~
跑下面的指令,就可以列出 JKS 檔案裡面的東西:
$ keytool -list -v -keystore test.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry Alias name: ca Creation date: Oct 9, 2024 Entry type: trustedCertEntry Owner: CN=Root CA, O=TestCompany, C=US Issuer: CN=Root CA, O=TestCompany, C=US Serial number: 256b34495e72af99561ea82ca4128abc Valid from: Wed Sep 11 21:13:57 CST 2024 until: Sun May 29 21:13:57 CST 2044 Certificate fingerprints: SHA1: 5A:79:C7:29:20:41:21:05:5F:71:20:10:4B:89:1B:D3:4B:4A:9A:1A SHA256: 80:B3:A8:2B:AE:F8:6F:F0:42:A3:20:5C:DE:1C:EE:91:21:F4:C4:DC:D5:F7:7E:8B:AF:16:A1:90:8F:0C:A3:1F Signature algorithm name: SHA256withRSA Subject Public Key Algorithm: 4096-bit RSA key Version: 3 Extensions: #1: ObjectId: 2.5.29.19 Criticality=true BasicConstraints:[ CA:true PathLen: no limit ] #2: ObjectId: 2.5.29.15 Criticality=true KeyUsage [ DigitalSignature Key_Encipherment Key_CertSign ] #3: ObjectId: 2.5.29.14 Criticality=false SubjectKeyIdentifier [ KeyIdentifier [ 0000: D2 45 4E DA F1 47 3B 63 B7 4F A0 72 F6 7C BA 53 .EN..G;c.O.r...S 0010: 39 73 21 58 9s!X ] ] ******************************************* *******************************************
(本頁面已被瀏覽過 19 次)