Changeset 9997 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2016-03-15T02:16:30+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
r9995 r9997 38 38 * 39 39 * The certificates are added in-memory at each start, nothing is written to disk. 40 * @since 9995 40 41 */ 41 public class CertificateAmendment { 42 public final class CertificateAmendment { 42 43 43 p ublicstatic final String[] CERT_AMEND = {44 private static final String[] CERT_AMEND = { 44 45 "resource://data/security/DST_Root_CA_X3.pem", 45 46 "resource://data/security/StartCom_Certification_Authority.pem" 46 47 }; 47 public static final String[] SHA_HASHES = { 48 49 private static final String[] SHA_HASHES = { 48 50 "139a5e4a4e0fa505378c72c5f700934ce8333f4e6b1b508886c4b0eb14f4be99", 49 51 "916a8f9232328192968c81c8edb672fa539f726861dfe379ca722050e19962cd" 50 52 }; 53 54 private CertificateAmendment() { 55 // Hide default constructor for utility classes 56 } 51 57 52 58 /** … … 81 87 for (int i = 0; i < CERT_AMEND.length; i++) { 82 88 CachedFile certCF = new CachedFile(CERT_AMEND[i]); 83 byte[] certBytes = certCF.getByteContent();84 89 MessageDigest md; 85 90 try { … … 88 93 throw new RuntimeException(ex); 89 94 } 95 byte[] certBytes = certCF.getByteContent(); 90 96 byte[] sha = md.digest(certBytes); 91 97 if (!SHA_HASHES[i].equals(Utils.toHexString(sha))) … … 131 137 */ 132 138 private static boolean certificateIsMissing(KeyStore keyStore, X509Certificate crt) { 133 String id = crt.getSubjectX500Principal().getName();134 139 PKIXParameters params; 135 140 try { … … 140 145 throw new RuntimeException(ex); 141 146 } 147 String id = crt.getSubjectX500Principal().getName(); 142 148 for (TrustAnchor ta : params.getTrustAnchors()) { 143 149 X509Certificate cert = ta.getTrustedCert();
Note:
See TracChangeset
for help on using the changeset viewer.
