public abstract class AbstractTlsSecret extends java.lang.Object implements TlsSecret
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data |
protected static int |
MD5_SIZE |
protected static byte[][] |
SSL3_CONST |
Modifier | Constructor and Description |
---|---|
protected |
AbstractTlsSecret(byte[] data)
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkAlive() |
TlsCipher |
createCipher(TlsCryptoParameters contextParams,
int encryptionAlgorithm,
int macAlgorithm)
Create a cipher suite that matches the passed in encryption algorithm and mac algorithm.
|
void |
destroy()
Destroy the internal state of the secret.
|
byte[] |
encrypt(TlsCertificate certificate)
Return the an encrypted copy of the data this secret is based on.
|
byte[] |
extract()
Return the internal data from this secret.
|
protected abstract AbstractTlsCrypto |
getCrypto() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deriveSSLKeyBlock, deriveSSLMasterSecret, deriveUsingPRF
protected static final int MD5_SIZE
protected static final byte[][] SSL3_CONST
protected byte[] data
protected AbstractTlsSecret(byte[] data)
data
- the byte[] making up the secret value.public byte[] encrypt(TlsCertificate certificate) throws java.io.IOException
TlsSecret
public void destroy()
TlsSecret
TlsSecret
will result in an IllegalStateException
being thrown.public byte[] extract()
TlsSecret
public TlsCipher createCipher(TlsCryptoParameters contextParams, int encryptionAlgorithm, int macAlgorithm) throws java.io.IOException
TlsSecret
See enumeration classes EncryptionAlgorithm
, MACAlgorithm
for appropriate argument values.
createCipher
in interface TlsSecret
contextParams
- context specific parameters.encryptionAlgorithm
- the encryption algorithm to be employed by the cipher suite.macAlgorithm
- the MAC algorithm to be employed by the cipher suite.java.io.IOException
protected void checkAlive()
protected abstract AbstractTlsCrypto getCrypto()