org.nhindirect.stagent.trust
Class TrustChainValidator

java.lang.Object
  extended by org.nhindirect.stagent.trust.TrustChainValidator

public class TrustChainValidator
extends Object

Validates the trust chain of a certificate with a set of anchors. If a certificate resolver is present, the validator will search for intermediate certificates.

Author:
Greg Meyer, Umesh Madan

Constructor Summary
TrustChainValidator()
           
 
Method Summary
 Collection<CertificateResolver> getCertificateResolver()
          Gets the intermediate certificate resolvers.
 boolean isCertificateResolver()
          Indicates if the TrustChainValidator has a certificate resolvers for resolving intermediates certificates.
 boolean isTrusted(X509Certificate certificate, Collection<X509Certificate> anchors)
          Indicates if a certificate is considered to be trusted by resolving a valid certificate trust chain with the provided anchors.
 void setCertificateResolver(Collection<CertificateResolver> resolver)
          Sets the intermediate certificate resolvers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrustChainValidator

public TrustChainValidator()
Method Detail

isCertificateResolver

public boolean isCertificateResolver()
Indicates if the TrustChainValidator has a certificate resolvers for resolving intermediates certificates.

Returns:
True is an intermediate certificate resolver is present. False otherwise.

getCertificateResolver

public Collection<CertificateResolver> getCertificateResolver()
Gets the intermediate certificate resolvers. This is generally a resolver capable of resolving public certificates.

Returns:
The intermediate certificate resolvers.

setCertificateResolver

public void setCertificateResolver(Collection<CertificateResolver> resolver)
Sets the intermediate certificate resolvers. This is generally a resolver capable of resolving public certificates.

Parameters:
resolver - the intermediate certificate resolver.

isTrusted

public boolean isTrusted(X509Certificate certificate,
                         Collection<X509Certificate> anchors)
Indicates if a certificate is considered to be trusted by resolving a valid certificate trust chain with the provided anchors.

Parameters:
certificate - The certificate to check.
anchors - A list of trust anchors used to check the trust chain.
Returns:
Returns true if the certificate can find a valid trust chain in the collection of anchors. False otherwise.


Copyright © 2010-2012 HNIN Direct. All Rights Reserved.