Class Overview
A generic TLS MAC implementation, which can be used with any kind of Digest to act as
an HMAC.
Summary
Public Constructors |
|
TlsMac(Digest digest, byte[] key_block, int offset, int len)
Generate a new instance of an TlsMac.
|
Public Methods |
byte[]
|
calculateMac(short type, byte[] message, int offset, int len)
Calculate the mac for some given data.
|
int
|
getSize()
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Fields
Public Constructors
public
TlsMac
(Digest digest, byte[] key_block, int offset, int len)
Generate a new instance of an TlsMac.
Parameters
digest
| The digest to use. |
key_block
| A byte-array where the key for this mac is located. |
offset
| The number of bytes to skip, before the key starts in the buffer. |
len
| The length of the key.
|
Public Methods
public
byte[]
calculateMac
(short type, byte[] message, int offset, int len)
Calculate the mac for some given data.
TlsMac will keep track of the sequence number internally.
Parameters
type
| The message type of the message. |
message
| A byte-buffer containing the message. |
offset
| The number of bytes to skip, before the message starts. |
len
| The length of the message. |
Returns
- A new byte-buffer containing the mac value.