Secure iNet Factory

com.jscape.inet.ftps
Class ContextFactory

java.lang.Object
  extended by com.jscape.inet.ftps.ContextFactory

public class ContextFactory
extends java.lang.Object

The SSL context factory.


Constructor Summary
ContextFactory()
          Creates a new factory instance.
ContextFactory(java.lang.String protocol, java.lang.String algorithm, java.lang.String provider)
          Creates a new factory instance.
ContextFactory(java.lang.String protocol, java.lang.String algorithm, java.lang.String keystoreProvider, java.lang.String protocolProvider, java.lang.String algorithmProvider, java.lang.String storeType, javax.net.ssl.KeyManager[] keyManagers, javax.net.ssl.TrustManager[] trustManagers)
           
 
Method Summary
 java.lang.String getAlgorithm()
          Returns the current algorithm for use in SSL communications.
 java.lang.String getAlgorithmProvider()
          Gets algorithm provider.
 javax.net.ssl.SSLContext getContext()
          Returns the SSL context instance.
 java.lang.String getKeystoreProvider()
          Gets keystore provider.
 java.lang.String getProtocol()
          Returns the current protocol.
 java.lang.String getProtocolProvider()
          Gets protocol provider.
 java.lang.String getStoreType()
          Returns the current keystore type.
 void setAlgorithm(java.lang.String algorithm)
          Sets algorithm for use in SSL communications Default is SunX509.
 void setAlgorithmProvider(java.lang.String algorithmProvider)
          Set algorithm provider.
 void setCertificates(java.security.KeyStore keyStore)
           
 void setCertificates(java.lang.String filename, java.lang.String password)
          Setups the trusted certificates.
 void setKeys(java.security.KeyStore keyStore, java.lang.String password)
           
 void setKeys(java.lang.String filename, java.lang.String password)
          Setups the client SSL keys.
 void setKeystoreProvider(java.lang.String keystoreProvider)
          Sets keystore provider.
 void setProtocol(java.lang.String protocol)
          Sets current protocol.
 void setProtocolProvider(java.lang.String protocolProvider)
          Sets the protocol provider.
 void setStoreType(java.lang.String type)
          Setups the current keystore type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextFactory

public ContextFactory(java.lang.String protocol,
                      java.lang.String algorithm,
                      java.lang.String keystoreProvider,
                      java.lang.String protocolProvider,
                      java.lang.String algorithmProvider,
                      java.lang.String storeType,
                      javax.net.ssl.KeyManager[] keyManagers,
                      javax.net.ssl.TrustManager[] trustManagers)

ContextFactory

public ContextFactory(java.lang.String protocol,
                      java.lang.String algorithm,
                      java.lang.String provider)
Creates a new factory instance.

Parameters:
protocol - the target protocol
algorithm - the target algorithm
provider - the target security provider

ContextFactory

public ContextFactory()
Creates a new factory instance.

Method Detail

getProtocol

public java.lang.String getProtocol()
Returns the current protocol. Default is TLS.

Returns:
the current protocol

setProtocol

public void setProtocol(java.lang.String protocol)
Sets current protocol. Default is TLS.

Parameters:
protocol -

getAlgorithm

public java.lang.String getAlgorithm()
Returns the current algorithm for use in SSL communications. Default is SunX509.

Returns:
the current algorithm

setAlgorithm

public void setAlgorithm(java.lang.String algorithm)
Sets algorithm for use in SSL communications Default is SunX509.

Parameters:
algorithm - the algorithm to use for SSL communications

getStoreType

public java.lang.String getStoreType()
Returns the current keystore type.

Returns:
the current keystore type

setStoreType

public void setStoreType(java.lang.String type)
Setups the current keystore type.

Parameters:
type - the current keystore type

setKeys

public void setKeys(java.lang.String filename,
                    java.lang.String password)
             throws FtpException
Setups the client SSL keys.

Parameters:
filename - the keystore filename
password - the file password
Throws:
FtpException - if an error occurs

setKeys

public void setKeys(java.security.KeyStore keyStore,
                    java.lang.String password)
             throws FtpException
Throws:
FtpException

setCertificates

public void setCertificates(java.lang.String filename,
                            java.lang.String password)
                     throws FtpException
Setups the trusted certificates.

Parameters:
filename - the trust store filename
password - the store password
Throws:
FtpException - if an error occurs

setCertificates

public void setCertificates(java.security.KeyStore keyStore)
                     throws FtpException
Throws:
FtpException

getContext

public javax.net.ssl.SSLContext getContext()
                                    throws FtpException
Returns the SSL context instance.

Returns:
the SSL context instance
Throws:
FtpException - if an instantiation error occurs

getAlgorithmProvider

public java.lang.String getAlgorithmProvider()
Gets algorithm provider.

Returns:
the algorithm provider

setAlgorithmProvider

public void setAlgorithmProvider(java.lang.String algorithmProvider)
Set algorithm provider.

Parameters:
algorithmProvider - The provider.

getKeystoreProvider

public java.lang.String getKeystoreProvider()
Gets keystore provider.

Returns:
keystore provider

setKeystoreProvider

public void setKeystoreProvider(java.lang.String keystoreProvider)
Sets keystore provider.

Parameters:
keystoreProvider - The provider.

getProtocolProvider

public java.lang.String getProtocolProvider()
Gets protocol provider.

Returns:
The protocol provider

setProtocolProvider

public void setProtocolProvider(java.lang.String protocolProvider)
Sets the protocol provider.

Parameters:
protocolProvider - protocol provider.

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved