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
public abstract class AbstractTlsSecret extends java.lang.Object implements TlsSecret
Base class for a TlsSecret implementation which captures common code and fields.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
data
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractTlsSecret(byte[] data)
Base constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkAlive()
void
destroy()
Destroy the internal state of the secret.byte[]
encrypt(TlsCertificate certificate)
Return an encrypted copy of the data this secret is based on.byte[]
extract()
Return the internal data from this secret.protected abstract AbstractTlsCrypto
getCrypto()
boolean
isAlive()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.tls.crypto.TlsSecret
deriveUsingPRF, hkdfExpand, hkdfExtract
-
-
-
-
Method Detail
-
checkAlive
protected void checkAlive()
-
getCrypto
protected abstract AbstractTlsCrypto getCrypto()
-
destroy
public void destroy()
Description copied from interface:TlsSecret
Destroy the internal state of the secret. After this call, any attempt to use theTlsSecret
will result in anIllegalStateException
being thrown.
-
encrypt
public byte[] encrypt(TlsCertificate certificate) throws java.io.IOException
Description copied from interface:TlsSecret
Return an encrypted copy of the data this secret is based on.
-
extract
public byte[] extract()
Description copied from interface:TlsSecret
-
-