Package org.bouncycastle.crypto.tls
Class TlsMac
- java.lang.Object
-
- org.bouncycastle.crypto.tls.TlsMac
-
public class TlsMac extends java.lang.Object
Deprecated.Migrate to the (D)TLS API in org.bouncycastle.tls (bctls jar).A generic TLS MAC implementation, acting as an HMAC based on some underlying Digest.
-
-
Field Summary
Fields Modifier and Type Field Description protected TlsContext
context
Deprecated.protected int
digestBlockSize
Deprecated.protected int
digestOverhead
Deprecated.protected Mac
mac
Deprecated.protected int
macLength
Deprecated.protected byte[]
secret
Deprecated.
-
Constructor Summary
Constructors Constructor Description TlsMac(TlsContext context, Digest digest, byte[] key, int keyOff, int keyLen)
Deprecated.Generate a new instance of an TlsMac.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description byte[]
calculateMac(long seqNo, short type, byte[] message, int offset, int length)
Deprecated.Calculate the MAC for some given data.byte[]
calculateMacConstantTime(long seqNo, short type, byte[] message, int offset, int length, int fullLength, byte[] dummyData)
Deprecated.protected int
getDigestBlockCount(int inputLength)
Deprecated.byte[]
getMACSecret()
Deprecated.int
getSize()
Deprecated.protected byte[]
truncate(byte[] bs)
Deprecated.
-
-
-
Field Detail
-
context
protected TlsContext context
Deprecated.
-
secret
protected byte[] secret
Deprecated.
-
mac
protected Mac mac
Deprecated.
-
digestBlockSize
protected int digestBlockSize
Deprecated.
-
digestOverhead
protected int digestOverhead
Deprecated.
-
macLength
protected int macLength
Deprecated.
-
-
Constructor Detail
-
TlsMac
public TlsMac(TlsContext context, Digest digest, byte[] key, int keyOff, int keyLen)
Deprecated.Generate a new instance of an TlsMac.- Parameters:
context
- the TLS client contextdigest
- The digest to use.key
- A byte-array where the key for this MAC is located.keyOff
- The number of bytes to skip, before the key starts in the buffer.keyLen
- The length of the key.
-
-
Method Detail
-
getMACSecret
public byte[] getMACSecret()
Deprecated.- Returns:
- the MAC write secret
-
getSize
public int getSize()
Deprecated.- Returns:
- The output length of this MAC.
-
calculateMac
public byte[] calculateMac(long seqNo, short type, byte[] message, int offset, int length)
Deprecated.Calculate the MAC for some given data.- 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.length
- The length of the message.- Returns:
- A new byte-buffer containing the MAC value.
-
calculateMacConstantTime
public byte[] calculateMacConstantTime(long seqNo, short type, byte[] message, int offset, int length, int fullLength, byte[] dummyData)
Deprecated.
-
getDigestBlockCount
protected int getDigestBlockCount(int inputLength)
Deprecated.
-
truncate
protected byte[] truncate(byte[] bs)
Deprecated.
-
-