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

public Class BcTlsCrypto

extends AbstractTlsCrypto
Class Inheritance
Imports
java.io.IOException, java.math.BigInteger, java.security.SecureRandom, java.util.Vector, org.bouncycastle.crypto.BlockCipher, .Digest, org.bouncycastle.crypto.agreement.srp.SRP6Client, .SRP6Server, .SRP6VerifierGenerator, org.bouncycastle.crypto.digests.GOST3411_2012_256Digest, .MD5Digest, .SHA1Digest, .SHA224Digest, .SHA256Digest, .SHA384Digest, .SHA512Digest, .SM3Digest, org.bouncycastle.crypto.engines.AESEngine, .ARIAEngine, .CamelliaEngine, .DESedeEngine, .SEEDEngine, .SM4Engine, org.bouncycastle.crypto.macs.HMac, org.bouncycastle.crypto.modes.AEADBlockCipher, .CBCBlockCipher, .CCMBlockCipher, .GCMBlockCipher, org.bouncycastle.crypto.params.SRP6GroupParameters, org.bouncycastle.crypto.prng.DigestRandomGenerator, org.bouncycastle.tls.AlertDescription, .CertificateType, .EncryptionAlgorithm, .HashAlgorithm, .MACAlgorithm, .NamedGroup, .ProtocolVersion, .SignatureAlgorithm, .SignatureAndHashAlgorithm, .SignatureScheme, .TlsFatalAlert, .TlsUtils, org.bouncycastle.tls.crypto.CryptoHashAlgorithm, .CryptoSignatureAlgorithm, .TlsCertificate, .TlsCipher, .TlsCryptoParameters, .TlsCryptoUtils, .TlsDHConfig, .TlsDHDomain, .TlsECConfig, .TlsECDomain, .TlsHMAC, .TlsHash, .TlsKemConfig, .TlsKemDomain, .TlsNonceGenerator, .TlsSRP6Client, .TlsSRP6Server, .TlsSRP6VerifierGenerator, .TlsSRPConfig, .TlsSecret, org.bouncycastle.tls.crypto.impl.AbstractTlsCrypto, .TlsAEADCipher, .TlsBlockCipher, .TlsImplUtils, .TlsNullCipher, org.bouncycastle.util.Arrays

Class for providing cryptographic services for TLS based on implementations in the BC light-weight API.

This class provides default implementations for everything. If you need to customise it, extend the class and override the appropriate methods.

Field Summary

Modifier and TypeField and Description
private final SecureRandom

Constructor Summary

AccessConstructor and Description
public
public
BcTlsCrypto(SecureRandom entropySource)

Method Summary

Modifier and TypeMethod and Description
pack-priv BcTlsSecret
adoptLocalSecret(byte[] data)

public Digest
cloneDigest(int cryptoHashAlgorithm, Digest digest)

protected AEADBlockCipher
protected AEADBlockCipher
protected AEADBlockCipher
protected AEADBlockCipher
protected AEADBlockCipher
protected AEADBlockCipher
protected BlockCipher
protected BlockCipher
protected BlockCipher
createBlockCipher(int encryptionAlgorithm)

protected BlockCipher
protected BlockCipher
protected BlockCipher
createCBCBlockCipher(int encryptionAlgorithm)

protected AEADBlockCipher
public TlsCertificate
createCertificate(byte[]
DER/BER encoding of the certificate of interest.
encoding
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createCertificate.

Create a TlsCertificate from an ASN.1 binary encoding of an X.509 certificate.

public TlsCertificate
createCertificate(short
Certificate type as per IANA TLS Certificate Types registry
type
,
byte[]
DER/BER encoding of the certificate of interest.
encoding
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createCertificate.

Create a TlsCertificate from a ASN.1 binary encoding of a certificate.

protected TlsCipher
public TlsCipher
createCipher(TlsCryptoParameters
context specific parameters.
cryptoParams
,
int
the encryption algorithm to be employed by the cipher.
encryptionAlgorithm
,
int
the MAC algorithm to be employed by the cipher.
macAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createCipher.

Create a cipher for the specified encryption and MAC algorithms.

protected TlsAEADCipher
createCipher_AES_CCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize)

protected TlsAEADCipher
createCipher_AES_GCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize)

protected TlsAEADCipher
createCipher_ARIA_GCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize)

protected TlsAEADCipher
createCipher_Camellia_GCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize)

protected TlsCipher
createCipher_CBC(TlsCryptoParameters cryptoParams, int encryptionAlgorithm, int cipherKeySize, int macAlgorithm)

protected TlsAEADCipher
protected TlsAEADCipher
protected BlockCipher
public TlsDHDomain
createDHDomain(TlsDHConfig
the config describing the DH parameters to use.
dhConfig
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createDHDomain.

Create a domain object supporting the domain parameters described in dhConfig.

public Digest
createDigest(int cryptoHashAlgorithm)

public TlsECDomain
createECDomain(TlsECConfig
the config describing the EC parameters to use.
ecConfig
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createECDomain.

Create a domain object supporting the domain parameters described in ecConfig.

protected AEADBlockCipher
public TlsHash
createHash(int
the hash algorithm the hash needs to implement.
cryptoHashAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createHash.

Create a suitable hash for the hash algorithm identifier passed in.

See enumeration class CryptoHashAlgorithm for appropriate argument values.

public TlsHMAC
createHMAC(int
the MAC algorithm the HMAC needs to match.
macAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createHMAC.

Create a suitable HMAC for the MAC algorithm identifier passed in.

See enumeration class MACAlgorithm for appropriate argument values.

protected TlsHMAC
createHMAC_SSL(int macAlgorithm)

public TlsHMAC
createHMACForHash(int
the hash algorithm the HMAC should use.
cryptoHashAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createHMACForHash.

Create a suitable HMAC using the hash algorithm identifier passed in.

See enumeration class CryptoHashAlgorithm for appropriate argument values.

public TlsKemDomain
createKemDomain(TlsKemConfig
the config describing the KEM parameters to use.
kemConfig
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createKemDomain.

Create a domain object supporting the domain parameters described in kemConfig.

protected TlsHMAC
createMAC(TlsCryptoParameters cryptoParams, int macAlgorithm)

public TlsNonceGenerator
createNonceGenerator(byte[]
context-specific seed material
additionalSeedMaterial
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createNonceGenerator.

Create a nonce generator.

protected TlsNullCipher
createNullCipher(TlsCryptoParameters cryptoParams, int macAlgorithm)

public TlsSecret
createSecret(byte[]
the data to base the TlsSecret on.
data
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSecret.

Create a TlsSecret object based on provided data.

protected BlockCipher
protected BlockCipher
public TlsSRP6Client
createSRP6Client(TlsSRPConfig
client config.
srpConfig
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSRP6Client.

Create an SRP-6 client.

public TlsSRP6Server
createSRP6Server(TlsSRPConfig
server config.
srpConfig
,
BigInteger
the SRP6 verifier value.
srpVerifier
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSRP6Server.

Create an SRP-6 server.

public TlsSRP6VerifierGenerator
createSRP6VerifierGenerator(TlsSRPConfig
generator config.
srpConfig
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSRP6VerifierGenerator.

Create an SRP-6 verifier generator.

public TlsSecret
generateRSAPreMasterSecret(ProtocolVersion
the client version to place in the first 2 bytes
version
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.generateRSAPreMasterSecret.

Create a TlsSecret object containing a randomly-generated RSA PreMasterSecret

public SecureRandom
getSecureRandom()

Implements org.bouncycastle.tls.crypto.TlsCrypto.getSecureRandom.

Return the primary (safest) SecureRandom for this crypto.

public boolean
hasAnyStreamVerifiers(Vector<E> signatureAndHashAlgorithms)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasAnyStreamVerifiers.

Return true if this TlsCrypto would use a stream verifier for any of the passed in algorithms.

public boolean
hasAnyStreamVerifiersLegacy(short[]
An array of ClientCertificateType values.
clientCertificateTypes
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasAnyStreamVerifiersLegacy.

Return true if this TlsCrypto would use a stream verifier for any of the passed in algorithms.

public boolean
hasCryptoHashAlgorithm(int
the algorithm of interest.
cryptoHashAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasCryptoHashAlgorithm.

Return true if this TlsCrypto can support the passed in hash algorithm.

public boolean
hasCryptoSignatureAlgorithm(int
the algorithm of interest.
cryptoSignatureAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasCryptoSignatureAlgorithm.

Return true if this TlsCrypto can support the passed in signature algorithm (not necessarily in combination with EVERY hash algorithm).

public boolean
hasDHAgreement()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasDHAgreement.

Return true if this TlsCrypto can support DH key agreement.

public boolean
hasECDHAgreement()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasECDHAgreement.

Return true if this TlsCrypto can support ECDH key agreement.

public boolean
hasEncryptionAlgorithm(int
the algorithm of interest.
encryptionAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasEncryptionAlgorithm.

Return true if this TlsCrypto can support the passed in block/stream encryption algorithm.

public boolean
hasHKDFAlgorithm(int
the algorithm of interest.
cryptoHashAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasHKDFAlgorithm.

Return true if this TlsCrypto can support HKDF with the passed in hash algorithm.

public boolean
hasKemAgreement()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasKemAgreement.

Return true if this TlsCrypto can support KEM key agreement.

public boolean
hasMacAlgorithm(int
the algorithm of interest.
macAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasMacAlgorithm.

Return true if this TlsCrypto can support the passed in MAC algorithm.

public boolean
hasNamedGroup(int namedGroup)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasNamedGroup.

Return true if this TlsCrypto supports the passed in named group value.

public boolean
hasRSAEncryption()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasRSAEncryption.

Return true if this TlsCrypto can support RSA encryption/decryption.

public boolean
hasSignatureAlgorithm(short
the algorithm of interest.
signatureAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureAlgorithm.

Return true if this TlsCrypto can support the passed in signature algorithm (not necessarily in combination with EVERY hash algorithm).

public boolean
hasSignatureAndHashAlgorithm(SignatureAndHashAlgorithm
the algorithm of interest.
sigAndHashAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureAndHashAlgorithm.

Return true if this TlsCrypto can support the passed in signature algorithm.

public boolean
hasSignatureScheme(int
the scheme of interest.
signatureScheme
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureScheme.

Return true if this TlsCrypto can support the passed in signature scheme.

public boolean
hasSRPAuthentication()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSRPAuthentication.

Return true if this TlsCrypto can support SRP authentication.

public TlsSecret
hkdfInit(int
the hash algorithm to instantiate HMAC with. See CryptoHashAlgorithm for values.
cryptoHashAlgorithm
)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hkdfInit.

Setup an initial "secret" for a chain of HKDF calls (RFC 5869), containing a string of HashLen zeroes.

Inherited from org.bouncycastle.tls.crypto.impl.AbstractTlsCrypto:
adoptSecret

Field Detail

entropySourceback to summary
private final SecureRandom entropySource

Constructor Detail

BcTlsCryptoback to summary
public BcTlsCrypto()
BcTlsCryptoback to summary
public BcTlsCrypto(SecureRandom entropySource)

Method Detail

adoptLocalSecretback to summary
pack-priv BcTlsSecret adoptLocalSecret(byte[] data)
cloneDigestback to summary
public Digest cloneDigest(int cryptoHashAlgorithm, Digest digest)
createAEADBlockCipher_AES_CCMback to summary
protected AEADBlockCipher createAEADBlockCipher_AES_CCM()
createAEADBlockCipher_AES_GCMback to summary
protected AEADBlockCipher createAEADBlockCipher_AES_GCM()
createAEADBlockCipher_ARIA_GCMback to summary
protected AEADBlockCipher createAEADBlockCipher_ARIA_GCM()
createAEADBlockCipher_Camellia_GCMback to summary
protected AEADBlockCipher createAEADBlockCipher_Camellia_GCM()
createAEADBlockCipher_SM4_CCMback to summary
protected AEADBlockCipher createAEADBlockCipher_SM4_CCM()
createAEADBlockCipher_SM4_GCMback to summary
protected AEADBlockCipher createAEADBlockCipher_SM4_GCM()
createAESEngineback to summary
protected BlockCipher createAESEngine()
createARIAEngineback to summary
protected BlockCipher createARIAEngine()
createBlockCipherback to summary
protected BlockCipher createBlockCipher(int encryptionAlgorithm) throws IOException
createCamelliaEngineback to summary
protected BlockCipher createCamelliaEngine()
createCBCBlockCipherback to summary
protected BlockCipher createCBCBlockCipher(BlockCipher blockCipher)
createCBCBlockCipherback to summary
protected BlockCipher createCBCBlockCipher(int encryptionAlgorithm) throws IOException
createCCMModeback to summary
protected AEADBlockCipher createCCMMode(BlockCipher engine)
createCertificateback to summary
public TlsCertificate createCertificate(byte[] encoding) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCrypto.createCertificate.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createCertificate.

Create a TlsCertificate from an ASN.1 binary encoding of an X.509 certificate.

Parameters
encoding:byte[]

DER/BER encoding of the certificate of interest.

Returns:TlsCertificate

a TlsCertificate.

Exceptions
IOException:
if there is an issue on decoding or constructing the certificate.
createCertificateback to summary
public TlsCertificate createCertificate(short type, byte[] encoding) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCrypto.createCertificate.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createCertificate.

Create a TlsCertificate from a ASN.1 binary encoding of a certificate.

Parameters
type:short

Certificate type as per IANA TLS Certificate Types registry

encoding:byte[]

DER/BER encoding of the certificate of interest.

Returns:TlsCertificate

a TlsCertificate.

Exceptions
IOException:
if there is an issue on decoding or constructing the certificate.
createChaCha20Poly1305back to summary
protected TlsCipher createChaCha20Poly1305(TlsCryptoParameters cryptoParams) throws IOException
createCipherback to summary
public TlsCipher createCipher(TlsCryptoParameters cryptoParams, int encryptionAlgorithm, int macAlgorithm) throws IOException

Implements org.bouncycastle.tls.crypto.TlsCrypto.createCipher.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createCipher.

Create a cipher for the specified encryption and MAC algorithms.

See enumeration classes EncryptionAlgorithm, MACAlgorithm for appropriate argument values.

Parameters
cryptoParams:TlsCryptoParameters

context specific parameters.

encryptionAlgorithm:int

the encryption algorithm to be employed by the cipher.

macAlgorithm:int

the MAC algorithm to be employed by the cipher.

Returns:TlsCipher

a TlsCipher implementing the encryption and MAC algorithms.

createCipher_AES_CCMback to summary
protected TlsAEADCipher createCipher_AES_CCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize) throws IOException
createCipher_AES_GCMback to summary
protected TlsAEADCipher createCipher_AES_GCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize) throws IOException
createCipher_ARIA_GCMback to summary
protected TlsAEADCipher createCipher_ARIA_GCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize) throws IOException
createCipher_Camellia_GCMback to summary
protected TlsAEADCipher createCipher_Camellia_GCM(TlsCryptoParameters cryptoParams, int cipherKeySize, int macSize) throws IOException
createCipher_CBCback to summary
protected TlsCipher createCipher_CBC(TlsCryptoParameters cryptoParams, int encryptionAlgorithm, int cipherKeySize, int macAlgorithm) throws IOException
createCipher_SM4_CCMback to summary
protected TlsAEADCipher createCipher_SM4_CCM(TlsCryptoParameters cryptoParams) throws IOException
createCipher_SM4_GCMback to summary
protected TlsAEADCipher createCipher_SM4_GCM(TlsCryptoParameters cryptoParams) throws IOException
createDESedeEngineback to summary
protected BlockCipher createDESedeEngine()
createDHDomainback to summary
public TlsDHDomain createDHDomain(TlsDHConfig dhConfig)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createDHDomain.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createDHDomain.

Create a domain object supporting the domain parameters described in dhConfig.

Parameters
dhConfig:TlsDHConfig

the config describing the DH parameters to use.

Returns:TlsDHDomain

a TlsDHDomain supporting the parameters in dhConfig.

createDigestback to summary
public Digest createDigest(int cryptoHashAlgorithm)
createECDomainback to summary
public TlsECDomain createECDomain(TlsECConfig ecConfig)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createECDomain.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createECDomain.

Create a domain object supporting the domain parameters described in ecConfig.

Parameters
ecConfig:TlsECConfig

the config describing the EC parameters to use.

Returns:TlsECDomain

a TlsECDomain supporting the parameters in ecConfig.

createGCMModeback to summary
protected AEADBlockCipher createGCMMode(BlockCipher engine)
createHashback to summary
public TlsHash createHash(int cryptoHashAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createHash.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createHash.

Create a suitable hash for the hash algorithm identifier passed in.

See enumeration class CryptoHashAlgorithm for appropriate argument values.

Parameters
cryptoHashAlgorithm:int

the hash algorithm the hash needs to implement.

Returns:TlsHash

a TlsHash.

createHMACback to summary
public TlsHMAC createHMAC(int macAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createHMAC.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createHMAC.

Create a suitable HMAC for the MAC algorithm identifier passed in.

See enumeration class MACAlgorithm for appropriate argument values.

Parameters
macAlgorithm:int

the MAC algorithm the HMAC needs to match.

Returns:TlsHMAC

a TlsHMAC.

createHMAC_SSLback to summary
protected TlsHMAC createHMAC_SSL(int macAlgorithm) throws IOException
createHMACForHashback to summary
public TlsHMAC createHMACForHash(int cryptoHashAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createHMACForHash.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createHMACForHash.

Create a suitable HMAC using the hash algorithm identifier passed in.

See enumeration class CryptoHashAlgorithm for appropriate argument values.

Parameters
cryptoHashAlgorithm:int

the hash algorithm the HMAC should use.

Returns:TlsHMAC

a TlsHMAC.

createKemDomainback to summary
public TlsKemDomain createKemDomain(TlsKemConfig kemConfig)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createKemDomain.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createKemDomain.

Create a domain object supporting the domain parameters described in kemConfig.

Parameters
kemConfig:TlsKemConfig

the config describing the KEM parameters to use.

Returns:TlsKemDomain

a TlsKemDomain supporting the parameters in kemConfig.

createMACback to summary
protected TlsHMAC createMAC(TlsCryptoParameters cryptoParams, int macAlgorithm) throws IOException
createNonceGeneratorback to summary
public TlsNonceGenerator createNonceGenerator(byte[] additionalSeedMaterial)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createNonceGenerator.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createNonceGenerator.

Create a nonce generator. Each call should construct a new generator, and the generator should be returned from this call only after automatically seeding from this TlsCrypto's entropy source, and from the provided additional seed material. The output of each returned generator must be completely independent of the others.

Parameters
additionalSeedMaterial:byte[]

context-specific seed material

Returns:TlsNonceGenerator

a TlsNonceGenerator

createNullCipherback to summary
protected TlsNullCipher createNullCipher(TlsCryptoParameters cryptoParams, int macAlgorithm) throws IOException
createSecretback to summary
public TlsSecret createSecret(byte[] data)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSecret.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createSecret.

Create a TlsSecret object based on provided data.

Parameters
data:byte[]

the data to base the TlsSecret on.

Returns:TlsSecret

a TlsSecret based on the provided data.

createSEEDEngineback to summary
protected BlockCipher createSEEDEngine()
createSM4Engineback to summary
protected BlockCipher createSM4Engine()
createSRP6Clientback to summary
public TlsSRP6Client createSRP6Client(TlsSRPConfig srpConfig)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSRP6Client.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createSRP6Client.

Create an SRP-6 client.

Parameters
srpConfig:TlsSRPConfig

client config.

Returns:TlsSRP6Client

an initialised SRP6 client object.

createSRP6Serverback to summary
public TlsSRP6Server createSRP6Server(TlsSRPConfig srpConfig, BigInteger srpVerifier)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSRP6Server.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createSRP6Server.

Create an SRP-6 server.

Parameters
srpConfig:TlsSRPConfig

server config.

srpVerifier:BigInteger

the SRP6 verifier value.

Returns:TlsSRP6Server

an initialised SRP6 server object.

createSRP6VerifierGeneratorback to summary
public TlsSRP6VerifierGenerator createSRP6VerifierGenerator(TlsSRPConfig srpConfig)

Implements org.bouncycastle.tls.crypto.TlsCrypto.createSRP6VerifierGenerator.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.createSRP6VerifierGenerator.

Create an SRP-6 verifier generator.

Parameters
srpConfig:TlsSRPConfig

generator config.

Returns:TlsSRP6VerifierGenerator

an initialized SRP6 verifier generator.

generateRSAPreMasterSecretback to summary
public TlsSecret generateRSAPreMasterSecret(ProtocolVersion version)

Implements org.bouncycastle.tls.crypto.TlsCrypto.generateRSAPreMasterSecret.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.generateRSAPreMasterSecret.

Create a TlsSecret object containing a randomly-generated RSA PreMasterSecret

Parameters
version:ProtocolVersion

the client version to place in the first 2 bytes

Returns:TlsSecret

a TlsSecret containing the PreMasterSecret.

getSecureRandomback to summary
public SecureRandom getSecureRandom()

Implements org.bouncycastle.tls.crypto.TlsCrypto.getSecureRandom.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.getSecureRandom.

Return the primary (safest) SecureRandom for this crypto.

Returns:SecureRandom

a SecureRandom suitable for key generation.

hasAnyStreamVerifiersback to summary
public boolean hasAnyStreamVerifiers(Vector<E> signatureAndHashAlgorithms)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasAnyStreamVerifiers.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasAnyStreamVerifiers.

Return true if this TlsCrypto would use a stream verifier for any of the passed in algorithms. This method is only relevant to handshakes negotiating (D)TLS 1.2.

Parameters
signatureAndHashAlgorithms:Vector<E>

A Vector of SignatureAndHashAlgorithm values.

Returns:boolean

true if this instance would use a stream verifier for any of the passed in algorithms, otherwise false.

hasAnyStreamVerifiersLegacyback to summary
public boolean hasAnyStreamVerifiersLegacy(short[] clientCertificateTypes)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasAnyStreamVerifiersLegacy.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasAnyStreamVerifiersLegacy.

Return true if this TlsCrypto would use a stream verifier for any of the passed in algorithms. This method is only relevant to handshakes negotiating (D)TLS versions older than 1.2.

Parameters
clientCertificateTypes:short[]

An array of ClientCertificateType values.

Returns:boolean

true if this instance would use a stream verifier for any of the passed in algorithms, otherwise false.

hasCryptoHashAlgorithmback to summary
public boolean hasCryptoHashAlgorithm(int cryptoHashAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasCryptoHashAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasCryptoHashAlgorithm.

Return true if this TlsCrypto can support the passed in hash algorithm.

Parameters
cryptoHashAlgorithm:int

the algorithm of interest.

Returns:boolean

true if cryptoHashAlgorithm is supported, false otherwise.

hasCryptoSignatureAlgorithmback to summary
public boolean hasCryptoSignatureAlgorithm(int cryptoSignatureAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasCryptoSignatureAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasCryptoSignatureAlgorithm.

Return true if this TlsCrypto can support the passed in signature algorithm (not necessarily in combination with EVERY hash algorithm).

Parameters
cryptoSignatureAlgorithm:int

the algorithm of interest.

Returns:boolean

true if cryptoSignatureAlgorithm is supported, false otherwise.

hasDHAgreementback to summary
public boolean hasDHAgreement()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasDHAgreement.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasDHAgreement.

Return true if this TlsCrypto can support DH key agreement.

Returns:boolean

true if this instance can support DH key agreement, false otherwise.

hasECDHAgreementback to summary
public boolean hasECDHAgreement()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasECDHAgreement.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasECDHAgreement.

Return true if this TlsCrypto can support ECDH key agreement.

Returns:boolean

true if this instance can support ECDH key agreement, false otherwise.

hasEncryptionAlgorithmback to summary
public boolean hasEncryptionAlgorithm(int encryptionAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasEncryptionAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasEncryptionAlgorithm.

Return true if this TlsCrypto can support the passed in block/stream encryption algorithm.

Parameters
encryptionAlgorithm:int

the algorithm of interest.

Returns:boolean

true if encryptionAlgorithm is supported, false otherwise.

hasHKDFAlgorithmback to summary
public boolean hasHKDFAlgorithm(int cryptoHashAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasHKDFAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasHKDFAlgorithm.

Return true if this TlsCrypto can support HKDF with the passed in hash algorithm.

Parameters
cryptoHashAlgorithm:int

the algorithm of interest.

Returns:boolean

true if HKDF is supported with cryptoHashAlgorithm, false otherwise.

hasKemAgreementback to summary
public boolean hasKemAgreement()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasKemAgreement.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasKemAgreement.

Return true if this TlsCrypto can support KEM key agreement.

Returns:boolean

true if this instance can support KEM key agreement, false otherwise.

hasMacAlgorithmback to summary
public boolean hasMacAlgorithm(int macAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasMacAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasMacAlgorithm.

Return true if this TlsCrypto can support the passed in MAC algorithm.

Parameters
macAlgorithm:int

the algorithm of interest.

Returns:boolean

true if macAlgorithm is supported, false otherwise.

hasNamedGroupback to summary
public boolean hasNamedGroup(int namedGroup)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasNamedGroup.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasNamedGroup.

Return true if this TlsCrypto supports the passed in named group value.

Returns:boolean

true if this instance supports the passed in named group value.

hasRSAEncryptionback to summary
public boolean hasRSAEncryption()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasRSAEncryption.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasRSAEncryption.

Return true if this TlsCrypto can support RSA encryption/decryption.

Returns:boolean

true if this instance can support RSA encryption/decryption, false otherwise.

hasSignatureAlgorithmback to summary
public boolean hasSignatureAlgorithm(short signatureAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureAlgorithm.

Return true if this TlsCrypto can support the passed in signature algorithm (not necessarily in combination with EVERY hash algorithm).

Parameters
signatureAlgorithm:short

the algorithm of interest.

Returns:boolean

true if signatureAlgorithm is supported, false otherwise.

hasSignatureAndHashAlgorithmback to summary
public boolean hasSignatureAndHashAlgorithm(SignatureAndHashAlgorithm sigAndHashAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureAndHashAlgorithm.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureAndHashAlgorithm.

Return true if this TlsCrypto can support the passed in signature algorithm.

Parameters
sigAndHashAlgorithm:SignatureAndHashAlgorithm

the algorithm of interest.

Returns:boolean

true if sigAndHashAlgorithm is supported, false otherwise.

hasSignatureSchemeback to summary
public boolean hasSignatureScheme(int signatureScheme)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureScheme.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasSignatureScheme.

Return true if this TlsCrypto can support the passed in signature scheme.

Parameters
signatureScheme:int

the scheme of interest.

Returns:boolean

true if signatureScheme is supported, false otherwise.

hasSRPAuthenticationback to summary
public boolean hasSRPAuthentication()

Implements org.bouncycastle.tls.crypto.TlsCrypto.hasSRPAuthentication.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hasSRPAuthentication.

Return true if this TlsCrypto can support SRP authentication.

Returns:boolean

true if this instance can support SRP authentication, false otherwise.

hkdfInitback to summary
public TlsSecret hkdfInit(int cryptoHashAlgorithm)

Implements org.bouncycastle.tls.crypto.TlsCrypto.hkdfInit.

Doc from org.bouncycastle.tls.crypto.TlsCrypto.hkdfInit.

Setup an initial "secret" for a chain of HKDF calls (RFC 5869), containing a string of HashLen zeroes.

Parameters
cryptoHashAlgorithm:int

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