Package org.eclipse.jetty.util.security
Class CertificateValidator
- java.lang.Object
-
- org.eclipse.jetty.util.security.CertificateValidator
-
@Deprecated(since="2021-05-27") public class CertificateValidator extends java.lang.Object
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Convenience class to handle validation of certificates, aliases and keystores Allows specifying Certificate Revocation List (CRL), as well as enabling CRL Distribution Points Protocol (CRLDP) certificate extension support, and also enabling On-Line Certificate Status Protocol (OCSP) support. IMPORTANT: at least one of the above mechanisms *MUST* be configured and operational, otherwise certificate validation *WILL FAIL* unconditionally.
-
-
Constructor Summary
Constructors Constructor Description CertificateValidator(java.security.KeyStore trustStore, java.util.Collection<? extends java.security.cert.CRL> crls)
Deprecated.creates an instance of the certificate validator
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.Collection<? extends java.security.cert.CRL>
getCrls()
Deprecated.int
getMaxCertPathLength()
Deprecated.java.lang.String
getOcspResponderURL()
Deprecated.java.security.KeyStore
getTrustStore()
Deprecated.boolean
isEnableCRLDP()
Deprecated.boolean
isEnableOCSP()
Deprecated.void
setEnableCRLDP(boolean enableCRLDP)
Deprecated.Enables CRL Distribution Points Supportvoid
setEnableOCSP(boolean enableOCSP)
Deprecated.Enables On-Line Certificate Status Protocol supportvoid
setMaxCertPathLength(int maxCertPathLength)
Deprecated.void
setOcspResponderURL(java.lang.String ocspResponderURL)
Deprecated.Set the location of the OCSP Responder.void
validate(java.security.cert.Certificate[] certChain)
Deprecated.void
validate(java.security.KeyStore keyStore)
Deprecated.validates all aliases inside of a given keystorejava.lang.String
validate(java.security.KeyStore keyStore, java.lang.String keyAlias)
Deprecated.validates a specific alias inside of the keystore being passed invoid
validate(java.security.KeyStore keyStore, java.security.cert.Certificate cert)
Deprecated.validates a specific certificate inside of the keystore being passed in
-
-
-
Constructor Detail
-
CertificateValidator
public CertificateValidator(java.security.KeyStore trustStore, java.util.Collection<? extends java.security.cert.CRL> crls)
Deprecated.creates an instance of the certificate validator- Parameters:
trustStore
- the truststore to usecrls
- the Certificate Revocation List to use
-
-
Method Detail
-
validate
public void validate(java.security.KeyStore keyStore) throws java.security.cert.CertificateException
Deprecated.validates all aliases inside of a given keystore- Parameters:
keyStore
- the keystore to validate- Throws:
java.security.cert.CertificateException
- if keystore error and unable to validate
-
validate
public java.lang.String validate(java.security.KeyStore keyStore, java.lang.String keyAlias) throws java.security.cert.CertificateException
Deprecated.validates a specific alias inside of the keystore being passed in- Parameters:
keyStore
- the keystore to validatekeyAlias
- the keyalias in the keystore to valid with- Returns:
- the keyAlias if valid
- Throws:
java.security.cert.CertificateException
- if keystore error and unable to validate
-
validate
public void validate(java.security.KeyStore keyStore, java.security.cert.Certificate cert) throws java.security.cert.CertificateException
Deprecated.validates a specific certificate inside of the keystore being passed in- Parameters:
keyStore
- the keystore to validate againstcert
- the certificate to validate- Throws:
java.security.cert.CertificateException
- if keystore error and unable to validate
-
validate
public void validate(java.security.cert.Certificate[] certChain) throws java.security.cert.CertificateException
Deprecated.- Throws:
java.security.cert.CertificateException
-
getTrustStore
public java.security.KeyStore getTrustStore()
Deprecated.
-
getCrls
public java.util.Collection<? extends java.security.cert.CRL> getCrls()
Deprecated.
-
getMaxCertPathLength
public int getMaxCertPathLength()
Deprecated.- Returns:
- Maximum number of intermediate certificates in the certification path (-1 for unlimited)
-
setMaxCertPathLength
public void setMaxCertPathLength(int maxCertPathLength)
Deprecated.- Parameters:
maxCertPathLength
- maximum number of intermediate certificates in the certification path (-1 for unlimited)
-
isEnableCRLDP
public boolean isEnableCRLDP()
Deprecated.- Returns:
- true if CRL Distribution Points support is enabled
-
setEnableCRLDP
public void setEnableCRLDP(boolean enableCRLDP)
Deprecated.Enables CRL Distribution Points Support- Parameters:
enableCRLDP
- true - turn on, false - turns off
-
isEnableOCSP
public boolean isEnableOCSP()
Deprecated.- Returns:
- true if On-Line Certificate Status Protocol support is enabled
-
setEnableOCSP
public void setEnableOCSP(boolean enableOCSP)
Deprecated.Enables On-Line Certificate Status Protocol support- Parameters:
enableOCSP
- true - turn on, false - turn off
-
getOcspResponderURL
public java.lang.String getOcspResponderURL()
Deprecated.- Returns:
- Location of the OCSP Responder
-
setOcspResponderURL
public void setOcspResponderURL(java.lang.String ocspResponderURL)
Deprecated.Set the location of the OCSP Responder.- Parameters:
ocspResponderURL
- location of the OCSP Responder
-
-