p2ps.peer
Interface TrustManager

All Known Implementing Classes:
DefaultTrustManager

public interface TrustManager

An interface implemented by trust managers. Trust managers decide whether to accept client/server certificates when a secure connection is created.

Version:
$Revision: 295 $
Author:
Ian Wang

Method Summary
 void acceptClientCertificate(SecurityContext peercontext, SecurityContext remotecontext, java.security.cert.X509Certificate[] chain, java.lang.String authtype, javax.net.ssl.X509TrustManager deftrustman)
          Check whether a client certificate should be accepted.
 void acceptServerCertificate(SecurityContext peercontext, SecurityContext remotecontext, java.security.cert.X509Certificate[] chain, java.lang.String authtype, javax.net.ssl.X509TrustManager deftrustman)
          Check whether a server certificate should be accepted.
 

Method Detail

acceptClientCertificate

public void acceptClientCertificate(SecurityContext peercontext,
                                    SecurityContext remotecontext,
                                    java.security.cert.X509Certificate[] chain,
                                    java.lang.String authtype,
                                    javax.net.ssl.X509TrustManager deftrustman)
                             throws java.security.cert.CertificateException
Check whether a client certificate should be accepted.

Parameters:
peercontext - the context for the local peer (server)
remotecontext - the context for the remote entity (client), or null if unknown
chain - the certificate chain received from the client
authtype - the authorization type for the certificate (e.g. RSA)
deftrustman - the default system trust manager
Throws:
java.security.cert.CertificateException - if the certificate is not accepted

acceptServerCertificate

public void acceptServerCertificate(SecurityContext peercontext,
                                    SecurityContext remotecontext,
                                    java.security.cert.X509Certificate[] chain,
                                    java.lang.String authtype,
                                    javax.net.ssl.X509TrustManager deftrustman)
                             throws java.security.cert.CertificateException
Check whether a server certificate should be accepted.

Parameters:
peercontext - the context for the local peer (client)
remotecontext - the context for the remote entity (server), or null if unknown
chain - the certificate chain received from the client
authtype - the authorization type for the certificate (e.g. RSA)
deftrustman - the default system trust manager
Throws:
java.security.cert.CertificateException - if the certificate is not accepted