Adding Certs to Java
- Download certificate
- Located on network share at
\\raven.disid.disney.com\public$\LDAPCert\certnew.cer
- Located on network share at
- Change directory to JDK root directory
cd "c:\Program Files\Java\jdk1.7.0_21"
- Import certificate file
- bin\keytool.exe -importcert -trustcacerts -keystore "jre/lib/security/cacerts." -file "c:\Users\dekod002\Downloads\certnew.cer" -alias disid
- When prompted for a keystore password, use
changeme(Windows) orchangeit(Linux+Mac)
Example (Windows)
c:\Program Files\Java\jdk1.7.0_21>bin\keytool.exe -importcert -trustcacerts -keystore "jre\lib\security\cacerts" -file c:\Users\dekod002\Downloads\certnew.cer -alias disid
Enter keystore password:
Owner: CN=wdig-NHCA01-CA, DC=WDIG, DC=COM
Issuer: CN=wdig-NHCA01-CA, DC=WDIG, DC=COM
Serial number: 5b2b0e2e626326ae40a5c73e730292bf
Valid from: Thu Apr 02 16:12:15 PDT 2009 until: Mon Apr 02 16:22:12 PDT 2029
Certificate fingerprints:
MD5: 51:DD:08:12:FB:2B:1B:57:EF:A4:A3:7A:56:A7:44:82
SHA1: 1C:F7:B4:3F:0D:30:50:47:04:8A:D6:90:F5:2B:0F:32:95:53:A7:2E
SHA256: B9:75:F7:89:A7:CF:02:C8:F1:E1:08:73:17:E9:3B:DB:EE:6B:32:DF:97:
07:25:90:55:79:3A:33:20:D5:FC:BC
Signature algorithm name: SHA1withRSA
Version: 3
Extensions:
#1: ObjectId: 1.3.6.1.4.1.311.20.2 Criticality=false
0000: 1E 04 00 43 00 41 ...C.A
#2: ObjectId: 1.3.6.1.4.1.311.21.1 Criticality=false
0000: 02 01 00 ...
#3: ObjectId: 2.5.29.19 Criticality=true
BasicConstraints:[
CA:true
PathLen:2147483647
]
#4: ObjectId: 2.5.29.15 Criticality=false
KeyUsage [
Non_repudiation
Key_CertSign
Crl_Sign
]
#5: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: B1 A6 B5 AB EE 5F E0 F4 AE 09 6C A1 49 10 B5 C9 ....._....l.I...
0010: 86 D8 2A 3E ..*>
]
]
Trust this certificate? [no]: yes
Certificate was added to keystore
c:\Program Files\Java\jdk1.7.0_21>