org.dmonix.net.ssl
Class SSLCertificateAccepter

java.lang.Object
  extended byorg.dmonix.net.ssl.SSLCertificateAccepter

public class SSLCertificateAccepter
extends java.lang.Object

Singleton class for handling SSL certificates.
The default built-in HostnameVerifier will always accept all certificates.

Copyright: Copyright (c) 2004

Company: dmonix.org

Version:
1.0
Author:
Peter Nerg

Field Summary
static java.lang.String PRINCIPAL_NAME
          The name of the principal.
 
Method Summary
static SSLCertificateAccepter getInstance()
          Get an instance of the SSLCertificateAccepter.
 void setHostNameVerifier(javax.net.ssl.HostnameVerifier verifier)
          Sets a new HostnameVerifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRINCIPAL_NAME

public static final java.lang.String PRINCIPAL_NAME
The name of the principal.

See Also:
Constant Field Values
Method Detail

getInstance

public static SSLCertificateAccepter getInstance()
                                          throws java.security.GeneralSecurityException,
                                                 java.io.IOException
Get an instance of the SSLCertificateAccepter.
Since this class is a singleton the method will always return the same SSLCertificateAccepter.
If the object is not instantiated a new instance will be created.

Returns:
the instance of the SSLCertificateAccepter
Throws:
java.security.GeneralSecurityException
java.io.IOException

setHostNameVerifier

public void setHostNameVerifier(javax.net.ssl.HostnameVerifier verifier)
Sets a new HostnameVerifier.
This allows the user to create own verifiers to manage the received certificates in any desired fashion.

Parameters:
verifier - The new HostNameVerifier
See Also:
HostnameVerifier


Copyright © 1998-2005 dmonix.org Peter Nerg, All Rights Reserved.