|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ssonet.mechanisms.integrity.AbstractIntegrityMechanism
Field Summary | |
protected boolean |
debug
|
protected boolean |
EOF
|
protected org.ssonet.util.ByteFIFO |
inBuffer
|
protected static int |
INBUFFER_SIZE
|
protected org.ssonet.io.IOStream |
ioStream
|
protected java.lang.String |
keyGeneratorAlgorithmName
|
protected int[] |
keyLengths
|
protected javax.crypto.Mac |
macIn
|
protected javax.crypto.Mac |
macOut
|
protected java.lang.String |
mechanismName
|
protected byte[] |
messageBuffer
|
protected java.lang.String[] |
modes
|
protected org.ssonet.mechanisms.MechanismConfiguration |
negotiatedMechConf
|
protected java.lang.String[] |
providers
|
protected int |
readBlockNumber
|
protected java.io.IOException |
readException
|
protected int |
readMode
|
protected int[] |
rounds
|
protected int |
validBytesToRead
|
protected java.lang.String[] |
variants
|
protected int |
writeBlockNumber
|
Fields inherited from interface org.ssonet.net.Mechanism |
KEYLENGTH, MODES, PROVIDERLIST, ROUNDS, VARIANTS |
Constructor Summary | |
AbstractIntegrityMechanism()
|
Method Summary | |
int |
available()
|
void |
closeIn()
Closes the input part of the ioStream |
void |
closeOut()
closes the output part of the ioStream |
protected java.security.spec.AlgorithmParameterSpec |
getAlgorithmParameterSpec(org.ssonet.mechanisms.MechanismConfiguration mechConf)
This method must be overriden in mechanisms, which need special algorithm parameters |
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)
Initialize without key exchange |
void |
init(org.ssonet.io.IOStream ioStream,
int securityGoal,
org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration,
org.ssonet.mechanisms.MechanismConfiguration partnerMechanismConfiguration,
org.ssonet.net.KeyExchange keyExchange)
Initialize with key exchange |
protected void |
initIOStream()
Initializes the data fields needed for the IOStream to work. |
protected org.ssonet.mechanisms.MechanismConfiguration |
negotiateMechConf(org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration,
org.ssonet.mechanisms.MechanismConfiguration partnerMechanismConfiguration)
This Method negotiates between two mechanismConfigurations. |
int |
read(byte[] buffer)
reads an array of bytes from the IOStream |
byte[] |
testDecrypt(byte[] buffer)
Applies the mac testing algorithm to the given buffer. |
byte[] |
testEncrypt(byte[] buffer)
Applies the MAC algorithm to the given buffer. |
void |
write(byte[] buffer)
writes an array of bytes to the IOStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean debug
protected java.lang.String mechanismName
protected int[] keyLengths
protected java.lang.String[] modes
protected java.lang.String[] providers
protected int[] rounds
protected java.lang.String[] variants
protected java.lang.String keyGeneratorAlgorithmName
protected org.ssonet.io.IOStream ioStream
protected javax.crypto.Mac macIn
protected javax.crypto.Mac macOut
protected org.ssonet.mechanisms.MechanismConfiguration negotiatedMechConf
protected org.ssonet.util.ByteFIFO inBuffer
protected static int INBUFFER_SIZE
protected byte[] messageBuffer
protected boolean EOF
protected java.io.IOException readException
protected int validBytesToRead
protected int readMode
protected int readBlockNumber
protected int writeBlockNumber
Constructor Detail |
public AbstractIntegrityMechanism()
Method Detail |
public int available()
available
in interface IOStream
public void closeIn() throws java.io.IOException
closeIn
in interface IOStream
java.io.IOException
public void closeOut() throws java.io.IOException
closeOut
in interface IOStream
java.io.IOException
public byte[] testEncrypt(byte[] buffer)
testEncrypt
in interface Mechanism
buffer
- the buffer to apply the MAC algorithm to
public byte[] testDecrypt(byte[] buffer)
testDecrypt
in interface Mechanism
buffer
- the buffer holding the data with MACs
public int read(byte[] buffer) throws java.io.IOException
read
in interface IOStream
buffer
- the buffer to be filled during the read operation
java.io.IOException
- if an error occures while reading from the IOStreampublic void write(byte[] buffer) throws java.io.IOException
write
in interface IOStream
buffer
- the buffer holding the data to write
java.io.IOException
- if an error occures while writing to the streamprotected java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec(org.ssonet.mechanisms.MechanismConfiguration mechConf)
public void init(org.ssonet.io.IOStream ioStream, int securityGoal, org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration)
init
in interface Mechanism
ioStream
- mechanism IOStreamsecurityGoal
- the security goal, for which the algorithm is usedownMechanismConfiguration
- own mechanism configurationprotected org.ssonet.mechanisms.MechanismConfiguration negotiateMechConf(org.ssonet.mechanisms.MechanismConfiguration ownMechanismConfiguration, org.ssonet.mechanisms.MechanismConfiguration partnerMechanismConfiguration) throws ParameterNotCompatibleException
ParameterNotCompatibleException
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
init
in interface Mechanism
ioStream
- mechanism IOStreamsecurityGoal
- the security goal, for which the algorithm is usedownMechanismConfiguration
- own mechanism configurationpartnerMechanismConfiguration
- partner mechanism configurationkeyExchange
- prepared key exchange protocol
java.lang.Exception
- if initialization failsprotected void initIOStream()
public org.ssonet.mechanisms.MechanismConfiguration getDefaultConfiguration()
getDefaultConfiguration
in interface Mechanism
public org.ssonet.mechanisms.MechanismConfiguration getConfiguration()
getConfiguration
in interface Mechanism
init
methods, or null
if the mechanism was not allready initialized.public java.lang.String[] getModes()
getModes
in interface Mechanism
public java.lang.String[] getProviders()
getProviders
in interface Mechanism
public java.lang.String[] getVariants()
getVariants
in interface Mechanism
public int[] getKeyLengths()
getKeyLengths
in interface Mechanism
public int[] getRounds()
getRounds
in interface Mechanism
public java.lang.String getName()
getName
in interface Mechanism
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |