org.apache.ftpserver.ssl
Class DefaultSslConfiguration

java.lang.Object
  extended by org.apache.ftpserver.ssl.DefaultSslConfiguration
All Implemented Interfaces:
SslConfiguration

public class DefaultSslConfiguration
extends java.lang.Object
implements SslConfiguration

Used to configure the SSL settings for the control channel or the data channel.


Constructor Summary
DefaultSslConfiguration()
           
 
Method Summary
 ClientAuth getClientAuth()
          Return the required client authentication setting
 java.lang.String[] getEnabledCipherSuites()
          Returns the cipher suites that should be enabled for this connection.
 java.lang.String getKeyAlias()
          Get the server key alias to be used for SSL communication
 java.lang.String getKeyPassword()
          The password used to load the key
 java.lang.String getKeystoreAlgorithm()
          The algorithm used to open the key store.
 java.io.File getKeystoreFile()
          The key store file used by this configuration
 java.lang.String getKeystorePassword()
          The password used to load the key store
 java.lang.String getKeystoreType()
          The key store type, defaults to @see KeyStore.getDefaultType()
 javax.net.ssl.SSLContext getSSLContext()
          Return the SSL context for this configuration
 javax.net.ssl.SSLContext getSSLContext(java.lang.String protocol)
          Return the SSL context for this configuration given the specified protocol
 java.lang.String getSslProtocol()
          The SSL protocol used for this channel.
 java.lang.String getTruststoreAlgorithm()
          The algorithm used to open the trust store.
 java.io.File getTruststoreFile()
           
 java.lang.String getTruststorePassword()
          The password used to load the trust store
 java.lang.String getTruststoreType()
          The trust store type, defaults to @see KeyStore.getDefaultType()
 void init()
          Configure secure server related properties.
 void setClientAuthentication(java.lang.String clientAuthReqd)
          Set what client authentication level to use, supported values are "yes" or "true" for required authentication, "want" for wanted authentication and "false" or "none" for no authentication.
 void setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)
          Set the allowed cipher suites, note that the exact list of supported cipher suites differs between JRE implementations.
 void setKeyAlias(java.lang.String keyAlias)
          Set the alias for the key to be used for SSL communication.
 void setKeyPassword(java.lang.String keyPass)
          Set the password used to load the key
 void setKeystoreAlgorithm(java.lang.String keystoreAlgorithm)
          Override the key store algorithm used to open the key store
 void setKeystoreFile(java.io.File keyStoreFile)
          Set the key store file to be used by this configuration
 void setKeystorePassword(java.lang.String keystorePass)
          Set the password used to load the key store
 void setKeystoreType(java.lang.String keystoreType)
          Set the key store type
 void setSslProtocol(java.lang.String sslProtocol)
          Set the SSL protocol used for this channel.
 void setTruststoreAlgorithm(java.lang.String trustStoreAlgorithm)
          Override the trust store algorithm used to open the trust store
 void setTruststoreFile(java.io.File trustStoreFile)
          Set the password used to load the trust store
 void setTruststorePassword(java.lang.String trustStorePass)
          Set the password used to load the trust store
 void setTruststoreType(java.lang.String trustStoreType)
          Set the trust store type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSslConfiguration

public DefaultSslConfiguration()
Method Detail

getKeystoreFile

public java.io.File getKeystoreFile()
The key store file used by this configuration

Returns:
The key store file

setKeystoreFile

public void setKeystoreFile(java.io.File keyStoreFile)
Set the key store file to be used by this configuration

Parameters:
keyStoreFile - A path to an existing key store file

getKeystorePassword

public java.lang.String getKeystorePassword()
The password used to load the key store

Returns:
The password

setKeystorePassword

public void setKeystorePassword(java.lang.String keystorePass)
Set the password used to load the key store

Parameters:
keystorePass - The password

getKeystoreType

public java.lang.String getKeystoreType()
The key store type, defaults to @see KeyStore.getDefaultType()

Returns:
The key store type

setKeystoreType

public void setKeystoreType(java.lang.String keystoreType)
Set the key store type

Parameters:
keystoreType - The key store type

getKeystoreAlgorithm

public java.lang.String getKeystoreAlgorithm()
The algorithm used to open the key store. Defaults to "SunX509"

Returns:
The key store algorithm

setKeystoreAlgorithm

public void setKeystoreAlgorithm(java.lang.String keystoreAlgorithm)
Override the key store algorithm used to open the key store

Parameters:
keystoreAlgorithm - The key store algorithm

getSslProtocol

public java.lang.String getSslProtocol()
The SSL protocol used for this channel. Supported values are "SSL" and "TLS". Defaults to "TLS".

Returns:
The SSL protocol

setSslProtocol

public void setSslProtocol(java.lang.String sslProtocol)
Set the SSL protocol used for this channel. Supported values are "SSL" and "TLS". Defaults to "TLS".

Parameters:
sslProtocol - The SSL protocol

setClientAuthentication

public void setClientAuthentication(java.lang.String clientAuthReqd)
Set what client authentication level to use, supported values are "yes" or "true" for required authentication, "want" for wanted authentication and "false" or "none" for no authentication. Defaults to "none".

Parameters:
clientAuthReqd - The desired authentication level

getKeyPassword

public java.lang.String getKeyPassword()
The password used to load the key

Returns:
The password

setKeyPassword

public void setKeyPassword(java.lang.String keyPass)
Set the password used to load the key

Parameters:
keyPass - The password

getTruststoreFile

public java.io.File getTruststoreFile()

setTruststoreFile

public void setTruststoreFile(java.io.File trustStoreFile)
Set the password used to load the trust store

Parameters:
trustStoreFile - The password

getTruststorePassword

public java.lang.String getTruststorePassword()
The password used to load the trust store

Returns:
The password

setTruststorePassword

public void setTruststorePassword(java.lang.String trustStorePass)
Set the password used to load the trust store

Parameters:
trustStorePass - The password

getTruststoreType

public java.lang.String getTruststoreType()
The trust store type, defaults to @see KeyStore.getDefaultType()

Returns:
The trust store type

setTruststoreType

public void setTruststoreType(java.lang.String trustStoreType)
Set the trust store type

Parameters:
keystoreType - The trust store type

getTruststoreAlgorithm

public java.lang.String getTruststoreAlgorithm()
The algorithm used to open the trust store. Defaults to "SunX509"

Returns:
The trust store algorithm

setTruststoreAlgorithm

public void setTruststoreAlgorithm(java.lang.String trustStoreAlgorithm)
Override the trust store algorithm used to open the trust store

Parameters:
trustStoreAlgorithm - The trust store algorithm

init

public void init()
Configure secure server related properties.


getSSLContext

public javax.net.ssl.SSLContext getSSLContext(java.lang.String protocol)
                                       throws java.security.GeneralSecurityException
Description copied from interface: SslConfiguration
Return the SSL context for this configuration given the specified protocol

Specified by:
getSSLContext in interface SslConfiguration
Parameters:
protocol - The protocol, SSL or TLS must be supported
Returns:
The SSLContext
Throws:
java.security.GeneralSecurityException
See Also:
SslConfiguration.getSSLContext(String)

getClientAuth

public ClientAuth getClientAuth()
Description copied from interface: SslConfiguration
Return the required client authentication setting

Specified by:
getClientAuth in interface SslConfiguration
Returns:
ClientAuth.NEED if client authentication is required, ClientAuth.WANT is client authentication is wanted or ClientAuth.NONE if no client authentication is the be performed
See Also:
SslConfiguration.getClientAuth()

getSSLContext

public javax.net.ssl.SSLContext getSSLContext()
                                       throws java.security.GeneralSecurityException
Description copied from interface: SslConfiguration
Return the SSL context for this configuration

Specified by:
getSSLContext in interface SslConfiguration
Returns:
The SSLContext
Throws:
java.security.GeneralSecurityException
See Also:
SslConfiguration.getSSLContext()

getEnabledCipherSuites

public java.lang.String[] getEnabledCipherSuites()
Description copied from interface: SslConfiguration
Returns the cipher suites that should be enabled for this connection. Must return null if the default (as decided by the JVM) cipher suites should be used.

Specified by:
getEnabledCipherSuites in interface SslConfiguration
Returns:
An array of cipher suites, or null.
See Also:
SslConfiguration.getEnabledCipherSuites()

setEnabledCipherSuites

public void setEnabledCipherSuites(java.lang.String[] enabledCipherSuites)
Set the allowed cipher suites, note that the exact list of supported cipher suites differs between JRE implementations.

Parameters:
enabledCipherSuites -

getKeyAlias

public java.lang.String getKeyAlias()
Get the server key alias to be used for SSL communication

Returns:
The alias, or null if none is set

setKeyAlias

public void setKeyAlias(java.lang.String keyAlias)
Set the alias for the key to be used for SSL communication. If the specified key store contains multiple keys, this alias can be set to select a specific key.

Parameters:
keyAlias - The alias to use, or null if JSSE should be allowed to choose the key.


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.