Top Description Fields Constructors Methods
org.bouncycastle.tls.crypto.impl

public abstract Class AbstractTlsSecret

extends Object
implements TlsSecret
Class Inheritance
All Implemented Interfaces
org.bouncycastle.tls.crypto.TlsSecret
Known Direct Subclasses
org.bouncycastle.tls.crypto.impl.jcajce.JceTlsSecret
Imports
java.io.IOException, org.bouncycastle.tls.crypto.TlsEncryptor, .TlsHMAC, .TlsSecret, org.bouncycastle.util.Arrays

Base class for a TlsSecret implementation which captures common code and fields.

Field Summary

Modifier and TypeField and Description
protected byte[]

Constructor Summary

AccessConstructor and Description
protected
AbstractTlsSecret(byte[]
the byte[] making up the secret value.
data
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public synchronized byte[]
calculateHMAC(int
the hash algorithm to instantiate HMAC with. See CryptoHashAlgorithm for values.
cryptoHashAlgorithm
,
byte[]
array containing the input data.
buf
,
int
offset into the input array the input starts at.
off
,
int
the length of the input data.
len
)

Implements org.bouncycastle.tls.crypto.TlsSecret.calculateHMAC.

Calculate an HMAC with this secret's data as the key.
protected void
protected static byte[]
pack-priv synchronized byte[]
public synchronized void
destroy()

Implements org.bouncycastle.tls.crypto.TlsSecret.destroy.

Destroy the internal state of the secret.
public synchronized byte[]
encrypt(TlsEncryptor
the encryptor to use for protecting the internal data.
encryptor
)

Implements org.bouncycastle.tls.crypto.TlsSecret.encrypt.

Return an encrypted copy of the data this secret is based on.
public synchronized byte[]
extract()

Implements org.bouncycastle.tls.crypto.TlsSecret.extract.

Return the internal data from this secret.
protected abstract AbstractTlsCrypto
public synchronized boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
protected byte[] data

Constructor Detail

AbstractTlsSecretback to summary
protected AbstractTlsSecret(byte[] data)

Base constructor.

Parameters
data:byte[]

the byte[] making up the secret value.

Method Detail

calculateHMACback to summary
public synchronized byte[] calculateHMAC(int cryptoHashAlgorithm, byte[] buf, int off, int len)

Implements org.bouncycastle.tls.crypto.TlsSecret.calculateHMAC.

Doc from org.bouncycastle.tls.crypto.TlsSecret.calculateHMAC.

Calculate an HMAC with this secret's data as the key.

Parameters
cryptoHashAlgorithm:int

the hash algorithm to instantiate HMAC with. See CryptoHashAlgorithm for values.

buf:byte[]

array containing the input data.

off:int

offset into the input array the input starts at.

len:int

the length of the input data.

checkAliveback to summary
protected void checkAlive()
copyDataback to summary
protected static byte[] copyData(AbstractTlsSecret other)
copyDataback to summary
pack-priv synchronized byte[] copyData()
destroyback to summary
public synchronized void destroy()

Implements org.bouncycastle.tls.crypto.TlsSecret.destroy.

Doc from org.bouncycastle.tls.crypto.TlsSecret.destroy.

Destroy the internal state of the secret. After this call, any attempt to use the TlsSecret will result in an IllegalStateException being thrown.

encryptback to summary
public synchronized byte[] encrypt(TlsEncryptor encryptor) throws IOException

Implements org.bouncycastle.tls.crypto.TlsSecret.encrypt.

Doc from org.bouncycastle.tls.crypto.TlsSecret.encrypt.

Return an encrypted copy of the data this secret is based on.

Parameters
encryptor:TlsEncryptor

the encryptor to use for protecting the internal data.

Returns:byte[]

an encrypted copy of this secret's internal data.

extractback to summary
public synchronized byte[] extract()

Implements org.bouncycastle.tls.crypto.TlsSecret.extract.

Doc from org.bouncycastle.tls.crypto.TlsSecret.extract.

Return the internal data from this secret. The TlsSecret does not keep a copy of the data. After this call, any attempt to use the TlsSecret will result in an IllegalStateException being thrown.

Returns:byte[]

the secret's internal data.

getCryptoback to summary
protected abstract AbstractTlsCrypto getCrypto()
isAliveback to summary
public synchronized boolean isAlive()

Implements org.bouncycastle.tls.crypto.TlsSecret.isAlive.