Class HttpsCertVerifier

java.lang.Object
net.sourceforge.jnlp.security.HttpsCertVerifier
All Implemented Interfaces:
CertVerifier

public class HttpsCertVerifier extends Object implements CertVerifier
  • Field Details

    • LOG

      private static final Logger LOG
    • chain

      private final X509Certificate[] chain
    • hostName

      private final String hostName
    • isTrusted

      private final boolean isTrusted
    • hostMatched

      private final boolean hostMatched
    • details

      private final ArrayList<String> details
  • Constructor Details

    • HttpsCertVerifier

      HttpsCertVerifier(X509Certificate[] chain, boolean isTrusted, boolean hostMatched, String hostName)
  • Method Details

    • getAlreadyTrustPublisher

      public boolean getAlreadyTrustPublisher()
      Specified by:
      getAlreadyTrustPublisher in interface CertVerifier
      Returns:
      if the publisher is already trusted
    • getCertPath

      public CertPath getCertPath()
      Specified by:
      getCertPath in interface CertVerifier
      Returns:
      a valid certificate path to this certificate being verified
    • getDetails

      public List<String> getDetails(CertPath certPath)
      Specified by:
      getDetails in interface CertVerifier
      Parameters:
      certPath - certificate
      Returns:
      the details regarding issue with this certificate
    • getMostSpecificCommonName

      static String getMostSpecificCommonName(X509Certificate c) throws InvalidNameException
      Returns:
      the last (most specific) CN of the subject, or null
      Throws:
      InvalidNameException
    • getNamesForCert

      private String getNamesForCert(X509Certificate c)
    • addToDetails

      private void addToDetails(String detail)
    • getPublisher

      public Certificate getPublisher(CertPath certPath)
      Specified by:
      getPublisher in interface CertVerifier
      Parameters:
      certPath - to be read for publisher
      Returns:
      the application's publisher's certificate.
    • getRoot

      public Certificate getRoot(CertPath certPath)
      Specified by:
      getRoot in interface CertVerifier
      Parameters:
      certPath - certificate
      Returns:
      the application's root's certificate. This may return the same certificate as getPublisher(CertPath certPath) in the event that the application is self signed.
    • getRootInCaCerts

      public boolean getRootInCaCerts()
      Specified by:
      getRootInCaCerts in interface CertVerifier
      Returns:
      if the root is in CA certs