Ignore:
Timestamp:
2016-03-15T02:16:30+01:00 (4 years ago)
Author:
Don-vip
Message:

sonar - various fixes + javadoc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java

    r9995 r9997  
    3838 *
    3939 * The certificates are added in-memory at each start, nothing is written to disk.
     40 * @since 9995
    4041 */
    41 public class CertificateAmendment {
     42public final class CertificateAmendment {
    4243
    43     public static final String[] CERT_AMEND = {
     44    private static final String[] CERT_AMEND = {
    4445        "resource://data/security/DST_Root_CA_X3.pem",
    4546        "resource://data/security/StartCom_Certification_Authority.pem"
    4647    };
    47     public static final String[] SHA_HASHES = {
     48
     49    private static final String[] SHA_HASHES = {
    4850        "139a5e4a4e0fa505378c72c5f700934ce8333f4e6b1b508886c4b0eb14f4be99",
    4951        "916a8f9232328192968c81c8edb672fa539f726861dfe379ca722050e19962cd"
    5052    };
     53
     54    private CertificateAmendment() {
     55        // Hide default constructor for utility classes
     56    }
    5157
    5258    /**
     
    8187        for (int i = 0; i < CERT_AMEND.length; i++) {
    8288            CachedFile certCF = new CachedFile(CERT_AMEND[i]);
    83             byte[] certBytes = certCF.getByteContent();
    8489            MessageDigest md;
    8590            try {
     
    8893                throw new RuntimeException(ex);
    8994            }
     95            byte[] certBytes = certCF.getByteContent();
    9096            byte[] sha = md.digest(certBytes);
    9197            if (!SHA_HASHES[i].equals(Utils.toHexString(sha)))
     
    131137     */
    132138    private static boolean certificateIsMissing(KeyStore keyStore, X509Certificate crt) {
    133         String id = crt.getSubjectX500Principal().getName();
    134139        PKIXParameters params;
    135140        try {
     
    140145            throw new RuntimeException(ex);
    141146        }
     147        String id = crt.getSubjectX500Principal().getName();
    142148        for (TrustAnchor ta : params.getTrustAnchors()) {
    143149            X509Certificate cert = ta.getTrustedCert();
Note: See TracChangeset for help on using the changeset viewer.