org.ssonet.net
Interface Mechanism

All Superinterfaces:
IOStream
All Known Implementing Classes:
AbstractAccountabilityMechanism, AbstractConfidentialityMechanism, AbstractIntegrityMechanism

public interface Mechanism
extends IOStream

The interface for a security mechanism applying security modifications to the allready open stream.


Field Summary
static java.lang.String KEYLENGTH
           
static java.lang.String MODES
           
static java.lang.String PROVIDERLIST
           
static java.lang.String ROUNDS
           
static java.lang.String VARIANTS
           
 
Method Summary
 org.ssonet.mechanisms.MechanismConfiguration getConfiguration()
           
 org.ssonet.mechanisms.MechanismConfiguration getDefaultConfiguration()
           
 int[] getKeyLengths()
           
 java.lang.String[] getModes()
           
 java.lang.String getName()
           
 java.lang.String[] getProviders()
           
 int[] getRounds()
           
 java.lang.String[] getVariants()
           
 void init(org.ssonet.io.IOStream ioStream, int securityGoal, org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration)
          Initializes the mechanism for securing the ioStream without interactive initialization steps.
 void init(org.ssonet.io.IOStream ioStream, int securityGoal, org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration, org.ssonet.mechanisms.MechanismConfiguration partnerMechanismConfiguration, org.ssonet.net.KeyExchange keyExchange)
          Initializes the mechanism for securing the ioStream.
 byte[] testDecrypt(byte[] buffer)
          Applies the mechanism in receiving mode (decrpytion for confidentiality mechanisms) to the specified buffer.
 byte[] testEncrypt(byte[] buffer)
          Applies the mechanism in sending mode (encryption for confidentiality mechanisms) to the specified buffer.
 
Methods inherited from interface org.ssonet.io.IOStream
available, closeIn, closeOut, read, write
 

Field Detail

KEYLENGTH

public static final java.lang.String KEYLENGTH
See Also:
Constant Field Values

PROVIDERLIST

public static final java.lang.String PROVIDERLIST
See Also:
Constant Field Values

MODES

public static final java.lang.String MODES
See Also:
Constant Field Values

ROUNDS

public static final java.lang.String ROUNDS
See Also:
Constant Field Values

VARIANTS

public static final java.lang.String VARIANTS
See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Returns:
name of the mechanism

getModes

public java.lang.String[] getModes()
Returns:
valid operation modes of the mechanism.

getProviders

public java.lang.String[] getProviders()
Returns:
valid crypto providers for the mechanism

getVariants

public java.lang.String[] getVariants()
Returns:
valid variants for the mechanism

getKeyLengths

public int[] getKeyLengths()
Returns:
valid keylengths for the mechanism

getRounds

public int[] getRounds()
Returns:
valid rounds for the mechanism

getDefaultConfiguration

public org.ssonet.mechanisms.MechanismConfiguration getDefaultConfiguration()
Returns:
a default configuration setting for the mechanism.

init

public void init(org.ssonet.io.IOStream ioStream,
                 int securityGoal,
                 org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration)
Initializes the mechanism for securing the ioStream without interactive initialization steps. It just takes the ownMechanismConfiguration and applies it to the mechanism. Additional parameters (e.g. keys) must be created by the mechanism itself.

Parameters:
ioStream - the stream to secure
securityGoal - the security goal, for which the mechanism will be applied
ownMechanismConfiguration - the configuration for initializing the mechanism

init

public void init(org.ssonet.io.IOStream ioStream,
                 int securityGoal,
                 org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration,
                 org.ssonet.mechanisms.MechanismConfiguration partnerMechanismConfiguration,
                 org.ssonet.net.KeyExchange keyExchange)
          throws java.lang.Exception
Initializes the mechanism for securing the ioStream. Before initializing the mechanism, the configuration must be negotiated between ownMechanismConfiguration and partnerMechanismConfiguration.

Interactive initialization steps must be carried out using the keyExchange object. The ioStream must not be used for transmitting data in the initialization phase.

Parameters:
ioStream - the stream to secure
securityGoal - the security goal, for which the mechanism will be applied
ownMechanismConfiguration - the own configuration for the mechanism
partnerMechanismConfiguration - the partners configuration for the mechanism
keyExchange - the object used for interactive initialization steps like the exchange of keys.
Throws:
java.lang.Exception - if something goes wrong during initialization

getConfiguration

public org.ssonet.mechanisms.MechanismConfiguration getConfiguration()
Returns:
the mechanism configuration of this mechanism after it was initialized by one of the init methods, or null if the mechanism was not allready initialized.

testEncrypt

public byte[] testEncrypt(byte[] buffer)
Applies the mechanism in sending mode (encryption for confidentiality mechanisms) to the specified buffer.

Parameters:
buffer - the buffer to apply the mechanism to
Returns:
a buffer holding the output of the mechanism

testDecrypt

public byte[] testDecrypt(byte[] buffer)
Applies the mechanism in receiving mode (decrpytion for confidentiality mechanisms) to the specified buffer.

Parameters:
buffer - the buffer to apply the mechanism to
Returns:
a buffer holding the output of the mechanism


Copyright © 2003 DRIM Team. All Rights Reserved.