Package org.bouncycastle.tls.crypto.impl
Class AbstractTlsSecret
java.lang.Object
org.bouncycastle.tls.crypto.impl.AbstractTlsSecret
- All Implemented Interfaces:
TlsSecret
- Direct Known Subclasses:
BcTlsSecret,JceTlsSecret
Base class for a TlsSecret implementation which captures common code and fields.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoiddestroy()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 AbstractTlsCryptobooleanisAlive()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bouncycastle.tls.crypto.TlsSecret
deriveUsingPRF, hkdfExpand, hkdfExtract
-
Field Details
-
data
protected byte[] data
-
-
Constructor Details
-
AbstractTlsSecret
protected AbstractTlsSecret(byte[] data) Base constructor.- Parameters:
data- the byte[] making up the secret value.
-
-
Method Details
-
checkAlive
protected void checkAlive() -
getCrypto
-
destroy
public void destroy()Description copied from interface:TlsSecretDestroy the internal state of the secret. After this call, any attempt to use theTlsSecretwill result in anIllegalStateExceptionbeing thrown. -
encrypt
Description copied from interface:TlsSecretReturn the an encrypted copy of the data this secret is based on.- Specified by:
encryptin interfaceTlsSecret- Parameters:
certificate- the certificate containing the public key to use for protecting the internal data.- Returns:
- an encrypted copy of secret's internal data.
- Throws:
IOException
-
extract
public byte[] extract()Description copied from interface:TlsSecretReturn the internal data from this secret. TheTlsSecretdoes not keep a copy of the data. After this call, any attempt to use theTlsSecretwill result in anIllegalStateExceptionbeing thrown. -
isAlive
public boolean isAlive()
-