|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.crypto.MacSpi | +--au.net.aba.crypto.provider.DESMac
This class implements the DES based MAC algorithm as defined in FIPS PUB 113.
This algorithm produces a 4 byte MAC value.
Currently this class will not work correctly unless the input data size is an exact multiple of 8. Data that isnt of this length should be padded with zeros. Eventually the DES cipher class will be modified to perform this function.
Constructor Summary | |
DESMac()
Default constructor, initialises the instance. |
Method Summary | |
protected byte[] |
engineDoFinal()
Completes the MAC computation and resets the MAC for further use, maintaining the secret key that the MAC was initialised with. |
protected int |
engineGetMacLength()
Returns the length of the MAC in bytes. |
protected void |
engineInit(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params)
Initialises the MAC with the given (secret) key and algorithm parameters. |
protected void |
engineReset()
Resets the MAC for further use, maintaining the secret key that the MAC was initialised with. |
protected void |
engineUpdate(byte input)
Processes the given byte. |
protected void |
engineUpdate(byte[] input,
int offset,
int len)
Processes the first len bytes in input, starting at offset. |
Methods inherited from class javax.crypto.MacSpi |
clone |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DESMac()
Method Detail |
protected int engineGetMacLength()
protected void engineInit(java.security.Key key, java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
key
parameter should be a
type that is compatible with the DES Cipher
.key
- the (secret) key.params
- the algorithm parameters.protected void engineUpdate(byte input)
input
- the input byte to be processed.protected void engineUpdate(byte[] input, int offset, int len)
input
- the input buffer.offset
- the offset in input where the input starts.len
- the number of bytes to process.protected byte[] engineDoFinal()
protected void engineReset()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |