org.apache.commons.ssl
Class TrustChain

java.lang.Object
  extended by org.apache.commons.ssl.TrustChain
Direct Known Subclasses:
TrustMaterial

public class TrustChain
extends Object

Since:
27-Feb-2006
Author:
Credit Union Central of British Columbia, www.cucbc.com, juliusdavies@cucbc.com

Field Summary
private  Set trustMaterial
           
private  KeyStore unifiedKeyStore
           
private  SortedSet x509Certificates
           
 
Constructor Summary
TrustChain()
           
 
Method Summary
 void addTrustMaterial(TrustChain tc)
           
 boolean contains(TrustChain tc)
           
 boolean contains(X509Certificate cert)
           
protected  boolean containsTrustAll()
           
 SortedSet getCertificates()
           
 int getSize()
           
 Object getTrustManagerFactory()
           
 Object[] getTrustManagers()
           
 KeyStore getUnifiedKeyStore()
           
 boolean isEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trustMaterial

private final Set trustMaterial

x509Certificates

private SortedSet x509Certificates

unifiedKeyStore

private KeyStore unifiedKeyStore
Constructor Detail

TrustChain

public TrustChain()
Method Detail

getUnifiedKeyStore

public KeyStore getUnifiedKeyStore()
                            throws KeyStoreException,
                                   IOException,
                                   NoSuchAlgorithmException,
                                   CertificateException
Throws:
KeyStoreException
IOException
NoSuchAlgorithmException
CertificateException

addTrustMaterial

public void addTrustMaterial(TrustChain tc)

contains

public boolean contains(TrustChain tc)

contains

public boolean contains(X509Certificate cert)
                 throws KeyStoreException,
                        IOException,
                        NoSuchAlgorithmException,
                        CertificateException
Throws:
KeyStoreException
IOException
NoSuchAlgorithmException
CertificateException

getTrustManagerFactory

public Object getTrustManagerFactory()
                              throws NoSuchAlgorithmException,
                                     KeyStoreException,
                                     IOException,
                                     CertificateException
Throws:
NoSuchAlgorithmException
KeyStoreException
IOException
CertificateException

getTrustManagers

public Object[] getTrustManagers()
                          throws NoSuchAlgorithmException,
                                 KeyStoreException,
                                 IOException,
                                 CertificateException
Returns:
Array of TrustManager[] - presumably these will be dropped into a call to SSLContext.init(). Note: returns null if this TrustChain doesn't contain anything to trust.
Throws:
NoSuchAlgorithmException - serious problems
KeyStoreException - serious problems
IOException - serious problems
CertificateException - serious problems

getCertificates

public SortedSet getCertificates()
                          throws KeyStoreException,
                                 IOException,
                                 NoSuchAlgorithmException,
                                 CertificateException
Returns:
All X509Certificates contained in this TrustChain as a SortedSet. The X509Certificates are sorted based on expiry date.

See org.apache.commons.ssl.Certificates.COMPARE_BY_EXPIRY.

Throws:
KeyStoreException - serious problems
IOException - serious problems
NoSuchAlgorithmException - serious problems
CertificateException - serious problems

getSize

public int getSize()
            throws KeyStoreException,
                   IOException,
                   NoSuchAlgorithmException,
                   CertificateException
Returns:
Count of all X509Certificates contained in this TrustChain.
Throws:
KeyStoreException
IOException
NoSuchAlgorithmException
CertificateException

isEmpty

public boolean isEmpty()
                throws KeyStoreException,
                       IOException,
                       NoSuchAlgorithmException,
                       CertificateException
Returns:
Count of all X509Certificates contained in this TrustChain.
Throws:
KeyStoreException
IOException
NoSuchAlgorithmException
CertificateException

containsTrustAll

protected boolean containsTrustAll()