Package net.sourceforge.jnlp.security
Class HttpsCertVerifier
- java.lang.Object
-
- net.sourceforge.jnlp.security.HttpsCertVerifier
-
- All Implemented Interfaces:
CertVerifier
public class HttpsCertVerifier extends java.lang.Object implements CertVerifier
-
-
Constructor Summary
Constructors Constructor Description HttpsCertVerifier(java.security.cert.X509Certificate[] chain, boolean isTrusted, boolean hostMatched, java.lang.String hostName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddToDetails(java.lang.String detail)booleangetAlreadyTrustPublisher()java.security.cert.CertPathgetCertPath()java.util.List<java.lang.String>getDetails(java.security.cert.CertPath certPath)(package private) static java.lang.StringgetMostSpecificCommonName(java.security.cert.X509Certificate c)private java.lang.StringgetNamesForCert(java.security.cert.X509Certificate c)java.security.cert.CertificategetPublisher(java.security.cert.CertPath certPath)java.security.cert.CertificategetRoot(java.security.cert.CertPath certPath)booleangetRootInCaCerts()
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
chain
private final java.security.cert.X509Certificate[] chain
-
hostName
private final java.lang.String hostName
-
isTrusted
private final boolean isTrusted
-
hostMatched
private final boolean hostMatched
-
details
private final java.util.ArrayList<java.lang.String> details
-
-
Method Detail
-
getAlreadyTrustPublisher
public boolean getAlreadyTrustPublisher()
- Specified by:
getAlreadyTrustPublisherin interfaceCertVerifier- Returns:
- if the publisher is already trusted
-
getCertPath
public java.security.cert.CertPath getCertPath()
- Specified by:
getCertPathin interfaceCertVerifier- Returns:
- a valid certificate path to this certificate being verified
-
getDetails
public java.util.List<java.lang.String> getDetails(java.security.cert.CertPath certPath)
- Specified by:
getDetailsin interfaceCertVerifier- Parameters:
certPath- certificate- Returns:
- the details regarding issue with this certificate
-
getMostSpecificCommonName
static java.lang.String getMostSpecificCommonName(java.security.cert.X509Certificate c) throws javax.naming.InvalidNameException- Returns:
- the last (most specific) CN of the subject, or null
- Throws:
javax.naming.InvalidNameException
-
getNamesForCert
private java.lang.String getNamesForCert(java.security.cert.X509Certificate c)
-
addToDetails
private void addToDetails(java.lang.String detail)
-
getPublisher
public java.security.cert.Certificate getPublisher(java.security.cert.CertPath certPath)
- Specified by:
getPublisherin interfaceCertVerifier- Parameters:
certPath- to be read for publisher- Returns:
- the application's publisher's certificate.
-
getRoot
public java.security.cert.Certificate getRoot(java.security.cert.CertPath certPath)
- Specified by:
getRootin interfaceCertVerifier- 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:
getRootInCaCertsin interfaceCertVerifier- Returns:
- if the root is in CA certs
-
-