org.eclipse.jetty.util.security
Class CertificateValidator

java.lang.Object
  extended by org.eclipse.jetty.util.security.CertificateValidator

public class CertificateValidator
extends Object

Convenience class to handle validation of certificates, aliases and keystores Currently handles certificate revocation lists, should evolve to handle ocsp as well TODO: consider the case of a null trust store, is that important? TODO: add what support for ocsp is needed, if any


Constructor Summary
CertificateValidator(KeyStore trustStore, Collection<? extends CRL> crls)
          creates an instance of the certificate validator
 
Method Summary
 Collection<? extends CRL> getCrls()
           
 int getMaxCertPathLength()
           
 KeyStore getTrustStore()
           
 void setMaxCertPathLength(int maxCertPathLength)
           
 void validate(KeyStore keyStore)
          validates all aliases inside of a given keystore
 void validate(KeyStore keyStore, Certificate cert)
          validates a specific certificate inside of the keystore being passed in
 String validate(KeyStore keyStore, String keyAlias)
          validates a specific alias inside of the keystore being passed in
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CertificateValidator

public CertificateValidator(KeyStore trustStore,
                            Collection<? extends CRL> crls)
creates an instance of the certificate validator

Parameters:
trustStore -
crls -
Method Detail

validate

public void validate(KeyStore keyStore)
              throws CertificateException
validates all aliases inside of a given keystore

Parameters:
keyStore -
Throws:
CertificateException

validate

public String validate(KeyStore keyStore,
                       String keyAlias)
                throws CertificateException
validates a specific alias inside of the keystore being passed in

Parameters:
keyStore -
keyAlias -
Returns:
the keyAlias if valid
Throws:
CertificateException

validate

public void validate(KeyStore keyStore,
                     Certificate cert)
              throws CertificateException
validates a specific certificate inside of the keystore being passed in

Parameters:
keyStore -
cert -
Throws:
CertificateException

getMaxCertPathLength

public int getMaxCertPathLength()

setMaxCertPathLength

public void setMaxCertPathLength(int maxCertPathLength)

getTrustStore

public KeyStore getTrustStore()

getCrls

public Collection<? extends CRL> getCrls()


Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.