Top Fields Constructors Methods
org.bouncycastle.tls.crypto.impl.bc

pack-priv final Class BcTlsHMAC

extends Object
implements TlsHMAC
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsHMAC, org.bouncycastle.tls.crypto.TlsMAC
Imports
org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.macs.HMac, org.bouncycastle.crypto.params.KeyParameter, org.bouncycastle.tls.crypto.TlsHMAC

Field Summary

Modifier and TypeField and Description
private final HMac

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public byte[]
calculateMAC()

Implements org.bouncycastle.tls.crypto.TlsMAC.calculateMAC.

Return calculated MAC for any input passed in.

public void
calculateMAC(byte[]
output array to write the MAC to.
output
,
int
offset into the output array to write the MAC to.
outOff
)

Implements org.bouncycastle.tls.crypto.TlsMAC.calculateMAC.

Write the calculated MAC to an output buffer.

public int
getInternalBlockSize()

Implements org.bouncycastle.tls.crypto.TlsHMAC.getInternalBlockSize.

Return the internal block size for the message digest underlying this HMAC service.

public int
getMacLength()

Implements org.bouncycastle.tls.crypto.TlsMAC.getMacLength.

Return the length of the MAC generated by this service.

public void
reset()

Implements org.bouncycastle.tls.crypto.TlsMAC.reset.

Reset the MAC underlying this service.

public void
setKey(byte[]
array holding the MAC key.
key
,
int
offset into the array the key starts at.
keyOff
,
int
length of the key in the array.
keyLen
)

Implements org.bouncycastle.tls.crypto.TlsMAC.setKey.

Set the key to be used by the MAC implementation supporting this service.

public void
update(byte[]
input array containing the data.
input
,
int
offset into the input array the input starts at.
inOff
,
int
the length of the input data.
length
)

Implements org.bouncycastle.tls.crypto.TlsMAC.update.

Update the MAC with the passed in input.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hmacback to summary
private final HMac hmac

Constructor Detail

BcTlsHMACback to summary
pack-priv BcTlsHMAC(HMac hmac)

Method Detail

calculateMACback to summary
public byte[] calculateMAC()

Implements org.bouncycastle.tls.crypto.TlsMAC.calculateMAC.

Doc from org.bouncycastle.tls.crypto.TlsMAC.calculateMAC.

Return calculated MAC for any input passed in.

Returns:byte[]

the MAC value.

calculateMACback to summary
public void calculateMAC(byte[] output, int outOff)

Implements org.bouncycastle.tls.crypto.TlsMAC.calculateMAC.

Doc from org.bouncycastle.tls.crypto.TlsMAC.calculateMAC.

Write the calculated MAC to an output buffer.

Parameters
output:byte[]

output array to write the MAC to.

outOff:int

offset into the output array to write the MAC to.

getInternalBlockSizeback to summary
public int getInternalBlockSize()

Implements org.bouncycastle.tls.crypto.TlsHMAC.getInternalBlockSize.

Doc from org.bouncycastle.tls.crypto.TlsHMAC.getInternalBlockSize.

Return the internal block size for the message digest underlying this HMAC service.

Returns:int

the internal block size for the digest (in bytes).

getMacLengthback to summary
public int getMacLength()

Implements org.bouncycastle.tls.crypto.TlsMAC.getMacLength.

Doc from org.bouncycastle.tls.crypto.TlsMAC.getMacLength.

Return the length of the MAC generated by this service.

Returns:int

the MAC length.

resetback to summary
public void reset()

Implements org.bouncycastle.tls.crypto.TlsMAC.reset.

Doc from org.bouncycastle.tls.crypto.TlsMAC.reset.

Reset the MAC underlying this service.

setKeyback to summary
public void setKey(byte[] key, int keyOff, int keyLen)

Implements org.bouncycastle.tls.crypto.TlsMAC.setKey.

Doc from org.bouncycastle.tls.crypto.TlsMAC.setKey.

Set the key to be used by the MAC implementation supporting this service.

Parameters
key:byte[]

array holding the MAC key.

keyOff:int

offset into the array the key starts at.

keyLen:int

length of the key in the array.

updateback to summary
public void update(byte[] input, int inOff, int length)

Implements org.bouncycastle.tls.crypto.TlsMAC.update.

Doc from org.bouncycastle.tls.crypto.TlsMAC.update.

Update the MAC with the passed in input.

Parameters
input:byte[]

input array containing the data.

inOff:int

offset into the input array the input starts at.

length:int

the length of the input data.