|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.digt.trusted.crypto.engines.GOST28147Engine
public class GOST28147Engine
a class that provides a basic GOST28147 engine.
Constructor Summary | |
---|---|
GOST28147Engine()
|
Method Summary | |
---|---|
void |
destroy()
|
protected void |
finalize()
|
java.lang.String |
getAlgorithmName()
Return the name of the algorithm the cipher implements. |
int |
getBlockSize()
Return the block size for this cipher (in bytes). |
java.lang.String |
getMode()
|
void |
init(boolean forEncryption,
CipherParameters params)
Initialise the cipher. |
void |
init(boolean forEncryption,
GOSTSessionKey seskey)
|
void |
init(int i,
java.security.Key key,
java.security.AlgorithmParameters ap,
java.security.SecureRandom sr)
|
int |
processBlock(byte[] in,
int inOff,
byte[] out,
int outOff)
Process one block of input from the array in and write it to the out array. |
int |
processBlock(byte[] in,
int inOff,
int length,
byte[] out,
int outOff)
Deprecated. Replaced by processBytes(byte[], int, int, byte[], int) since 2.0. |
int |
processBlocks(byte[] in,
int inOff,
byte[] out,
int outOff,
int blocks)
Process the number of blocks of input from the array in and write it to the out array. |
void |
processBytes(byte[] in,
int inOff,
int len,
byte[] out,
int outOff)
Process an array of bytes from in putting the result into out. |
void |
reset()
Reset the cipher. |
void |
setMode(java.lang.String mode)
Set mode chipher indirect |
void |
setMode(java.lang.String mode,
byte[] IV)
Set mode chipher with initial vector |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GOST28147Engine()
Method Detail |
---|
public void init(int i, java.security.Key key, java.security.AlgorithmParameters ap, java.security.SecureRandom sr) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyException
java.security.InvalidAlgorithmParameterException
public void init(boolean forEncryption, CipherParameters params) throws java.lang.IllegalArgumentException
init
in interface BlockCipher
forEncryption
- if true the cipher is initialised for
encryption, if false for decryption.params
- the key and other data required by the cipher.
java.lang.IllegalArgumentException
- if the params argument is
inappropriate.public void init(boolean forEncryption, GOSTSessionKey seskey) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, java.lang.IllegalStateException
processBlock
in interface BlockCipher
in
- the array containing the input data.inOff
- offset into the in array the data starts at.out
- the array the output data will be copied into.outOff
- the offset into the out array the output will start at.
DataLengthException
- if there isn't enough data in in, or
space in out.
java.lang.IllegalStateException
- if the cipher isn't initialised.public int processBlock(byte[] in, int inOff, int length, byte[] out, int outOff) throws DataLengthException, java.lang.IllegalStateException
processBytes(byte[], int, int, byte[], int)
since 2.0.
DataLengthException
java.lang.IllegalStateException
public int processBlocks(byte[] in, int inOff, byte[] out, int outOff, int blocks) throws DataLengthException, java.lang.IllegalStateException
processBlocks
in interface BlockCipher
in
- the array containing the input data.inOff
- offset into the in array the data starts at.out
- the array the output data will be copied into.outOff
- the offset into the out array the output will start at.blocks
- the number of blocks to process.
DataLengthException
- if there isn't enough data in in, or
space in out.
java.lang.IllegalStateException
- if the cipher isn't initialised.public void processBytes(byte[] in, int inOff, int len, byte[] out, int outOff) throws DataLengthException, java.lang.IllegalStateException, RuntimeCryptoException
in
- the input byte array.inOff
- the offset into the in array where the data to be processed starts.len
- the number of bytes to be processed.out
- the output buffer the processed bytes go into.outOff
- the offset into the output byte array the processed data stars at.
DataLengthException
- if the output buffer is too small.
java.lang.IllegalStateException
- if the cipher isn't initialised.
RuntimeCryptoException
- on other crypto operation errors.public java.lang.String getAlgorithmName()
getAlgorithmName
in interface BlockCipher
public void setMode(java.lang.String mode)
public void setMode(java.lang.String mode, byte[] IV)
public java.lang.String getMode()
public int getBlockSize()
getBlockSize
in interface BlockCipher
public void reset()
reset
in interface BlockCipher
public void destroy()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |