org.apache.ftpserver.ssl
Class SslConfigurationFactory

java.lang.Object
  extended by org.apache.ftpserver.ssl.SslConfigurationFactory

public class SslConfigurationFactory
extends java.lang.Object

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

Version:
$Rev: 693604 $, $Date: 2008-09-09 22:55:19 +0200 (Tue, 09 Sep 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
SslConfigurationFactory()
           
 
Method Summary
 SslConfiguration createSslConfiguration()
          Create an instance of SslConfiguration based on the configuration of this factory.
 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()
 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()
          Get the file used to load the truststore
 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 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

SslConfigurationFactory

public SslConfigurationFactory()
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()
Get the file used to load the truststore

Returns:
The File containing the truststore

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:
trustStoreType - 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

createSslConfiguration

public SslConfiguration createSslConfiguration()
Create an instance of SslConfiguration based on the configuration of this factory.

Returns:
The SslConfiguration instance

getClientAuth

public ClientAuth getClientAuth()
Return the required client authentication setting

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

getEnabledCipherSuites

public java.lang.String[] getEnabledCipherSuites()
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.

Returns:
An array of cipher suites, or null.

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-2011 Apache Software Foundation. All Rights Reserved.