org.semanticdesktop.aperture.security.trustmanager.standard
Class StandardTrustManager

java.lang.Object
  extended by org.semanticdesktop.aperture.security.trustmanager.standard.StandardTrustManager
All Implemented Interfaces:
TrustManager, X509TrustManager

public class StandardTrustManager
extends Object
implements X509TrustManager

A default implementation, well-suited for most environments, of X509TrustManager. It handles all certificates that can be validated by the system certificates and uses a delegate mechanism to decide what to do with unknown certificates. Such a delegate may for example show a dialog asking the user what to do, similar to what web browsers and mail readers typically do.


Constructor Summary
StandardTrustManager()
          Create a StandardTrustManager that has no persistent storage for permanently approved certificates.
StandardTrustManager(File pcsFile, char[] pcsPassword)
          Create a StandardTrustManager that uses the specified File to store its permanently approved certificates.
 
Method Summary
 void checkClientTrusted(X509Certificate[] chain, String authType)
           
 void checkServerTrusted(X509Certificate[] chain, String authType)
           
 X509Certificate[] getAcceptedIssuers()
           
 TrustDecider getTrustDecider()
           
 void setTrustDecider(TrustDecider trustDecider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardTrustManager

public StandardTrustManager()
                     throws CertificateException,
                            KeyStoreException,
                            NoSuchAlgorithmException,
                            NoSuchProviderException,
                            IOException
Create a StandardTrustManager that has no persistent storage for permanently approved certificates.

Throws:
CertificateException
KeyStoreException
NoSuchAlgorithmException
NoSuchProviderException
IOException

StandardTrustManager

public StandardTrustManager(File pcsFile,
                            char[] pcsPassword)
                     throws CertificateException,
                            KeyStoreException,
                            IOException,
                            NoSuchAlgorithmException,
                            NoSuchProviderException
Create a StandardTrustManager that uses the specified File to store its permanently approved certificates.

Parameters:
pcsFile - A File to load and store the certificates, or null when no certificates should be loaded and stored.
pcsPassword - The password used to check the integrity of the keystore, the password used to unlock the keystore, or null.
Throws:
CertificateException
KeyStoreException
IOException
NoSuchAlgorithmException
NoSuchProviderException
Method Detail

setTrustDecider

public void setTrustDecider(TrustDecider trustDecider)

getTrustDecider

public TrustDecider getTrustDecider()

checkClientTrusted

public void checkClientTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
Specified by:
checkClientTrusted in interface X509TrustManager
Throws:
CertificateException

checkServerTrusted

public void checkServerTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
Specified by:
checkServerTrusted in interface X509TrustManager
Throws:
CertificateException

getAcceptedIssuers

public X509Certificate[] getAcceptedIssuers()
Specified by:
getAcceptedIssuers in interface X509TrustManager


Copyright © 2010 Aperture Development Team. All Rights Reserved.