Top Description Methods
com.ongres.scram.common.bouncycastle.pbkdf2

public Interface Mac

Known Direct Implementers
com.ongres.scram.common.bouncycastle.pbkdf2.HMac

The base interface for implementations of message authentication codes (MACs).

Method Summary

Modifier and TypeMethod and Description
public int
doFinal(byte[]
the array the MAC is to be output to.
out
,
int
the offset into the out buffer the output is to start at.
outOff
)

Compute the final stage of the MAC writing the output to the out parameter.

public String

Returns:

the name of the algorithm the MAC implements.
getAlgorithmName
()

Return the name of the algorithm the MAC implements.

public int

Returns:

the block size for this MAC in bytes.
getMacSize
()

Return the block size for this MAC (in bytes).

public void
init(CipherParameters
the key and other data required by the MAC.
params
)

Initialise the MAC.

public void
reset()

Reset the MAC.

public void
update(byte
the byte to be processed.
in
)

add a single byte to the mac for processing.

public void
update(byte[]
the array containing the input.
in
,
int
the index in the array the data begins at.
inOff
,
int
the length of the input starting at inOff.
len
)

Method Detail

doFinalback to summary
public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException

Compute the final stage of the MAC writing the output to the out parameter.

doFinal leaves the MAC in the same state it was after the last init.

Parameters
out:byte[]

the array the MAC is to be output to.

outOff:int

the offset into the out buffer the output is to start at.

Exceptions
DataLengthException:
if there isn't enough space in out.
IllegalStateException:
if the MAC is not initialised.
getAlgorithmNameback to summary
public String getAlgorithmName()

Return the name of the algorithm the MAC implements.

Returns:String

the name of the algorithm the MAC implements.

getMacSizeback to summary
public int getMacSize()

Return the block size for this MAC (in bytes).

Returns:int

the block size for this MAC in bytes.

initback to summary
public void init(CipherParameters params) throws IllegalArgumentException

Initialise the MAC.

Parameters
params:CipherParameters

the key and other data required by the MAC.

Exceptions
IllegalArgumentException:
if the params argument is inappropriate.
resetback to summary
public void reset()

Reset the MAC. At the end of resetting the MAC should be in the in the same state it was after the last init (if there was one).

updateback to summary
public void update(byte in) throws IllegalStateException

add a single byte to the mac for processing.

Parameters
in:byte

the byte to be processed.

Exceptions
IllegalStateException:
if the MAC is not initialised.
updateback to summary
public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException
Parameters
in:byte[]

the array containing the input.

inOff:int

the index in the array the data begins at.

len:int

the length of the input starting at inOff.

Exceptions
DataLengthException:
if there isn't enough data in in.
IllegalStateException:
if the MAC is not initialised.