Class BcTlsSecret
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.AbstractTlsSecret
-
- org.bouncycastle.tls.crypto.impl.bc.BcTlsSecret
-
- All Implemented Interfaces:
TlsSecret
public class BcTlsSecret extends AbstractTlsSecret
BC light-weight support class for handling TLS secrets and deriving key material and other secrets from them.
-
-
Field Summary
Fields Modifier and Type Field Description protected BcTlsCrypto
crypto
-
Fields inherited from class org.bouncycastle.tls.crypto.impl.AbstractTlsSecret
data
-
-
Constructor Summary
Constructors Constructor Description BcTlsSecret(BcTlsCrypto crypto, byte[] data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TlsSecret
adoptLocalSecret(byte[] data)
TlsSecret
deriveUsingPRF(int prfAlgorithm, java.lang.String label, byte[] seed, int length)
Return a new secret based on applying a PRF to this one.protected AbstractTlsCrypto
getCrypto()
protected void
hmacHash(org.bouncycastle.crypto.Digest digest, byte[] secret, int secretOff, int secretLen, byte[] seed, byte[] output)
protected byte[]
prf_1_0(byte[] secret, byte[] labelSeed, int length)
protected byte[]
prf_1_2(int prfAlgorithm, byte[] secret, byte[] labelSeed, int length)
-
Methods inherited from class org.bouncycastle.tls.crypto.impl.AbstractTlsSecret
checkAlive, createCipher, destroy, encrypt, extract, hkdfExpand, hkdfExtract
-
-
-
-
Field Detail
-
crypto
protected final BcTlsCrypto crypto
-
-
Constructor Detail
-
BcTlsSecret
public BcTlsSecret(BcTlsCrypto crypto, byte[] data)
-
-
Method Detail
-
deriveUsingPRF
public TlsSecret deriveUsingPRF(int prfAlgorithm, java.lang.String label, byte[] seed, int length)
Description copied from interface:TlsSecret
Return a new secret based on applying a PRF to this one.- Parameters:
prfAlgorithm
- PRF algorithm to use.label
- the label details.seed
- the seed details.length
- the size (in bytes) of the secret to generate.- Returns:
- the new secret.
-
adoptLocalSecret
protected TlsSecret adoptLocalSecret(byte[] data)
- Specified by:
adoptLocalSecret
in classAbstractTlsSecret
-
getCrypto
protected AbstractTlsCrypto getCrypto()
- Specified by:
getCrypto
in classAbstractTlsSecret
-
hmacHash
protected void hmacHash(org.bouncycastle.crypto.Digest digest, byte[] secret, int secretOff, int secretLen, byte[] seed, byte[] output)
-
prf_1_0
protected byte[] prf_1_0(byte[] secret, byte[] labelSeed, int length)
-
prf_1_2
protected byte[] prf_1_2(int prfAlgorithm, byte[] secret, byte[] labelSeed, int length)
-
-