This class duplicates the HMAC functionality (RFC 2104) with performance optimizations (e.g. XOR'ing keys with padding doesn't need to be redone for each HMAC operation).
| Modifier and Type | Class and Description |
|---|---|
| public static class | TlsPrfGenerator.
A KeyGenerator implementation that supports TLS 1.0/1.1. |
| public static class | TlsPrfGenerator.
A KeyGenerator implementation that supports TLS 1.2. |
| Modifier and Type | Field and Description |
|---|---|
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| private static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| pack-priv static final byte[] | |
| private static final String | |
| private TlsPrfParameterSpec | spec
References Deprecated
TlsPrfParameterSpec is deprecated or references (maybe indirectly) at least one deprecated element.
|
| pack-priv static final byte[][] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static byte[] | |
| pack-priv static byte[] | |
| pack-priv static byte[] | doTLS10PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength, MessageDigest md5, MessageDigest sha)
|
| pack-priv static byte[] | doTLS12PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength, String prfHash, int prfHashLength, int prfBlockSize)
|
| pack-priv static byte[] | doTLS12PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength, MessageDigest mdPRF, int mdPRFLen, int mdPRFBlockSize)
|
| protected SecretKey | |
| protected void | engineInit(SecureRandom random)
Implements abstract javax. Initializes the key generator. |
| protected void | engineInit(AlgorithmParameterSpec params, SecureRandom random)
Implements abstract javax. Initializes the key generator with the specified parameter set and a user-provided source of randomness. |
| protected void | engineInit(int keysize, SecureRandom random)
Implements abstract javax. Initializes this key generator for a certain keysize, using the given source of randomness. |
| private static void | expand(MessageDigest digest, int hmacSize, byte[] secret, int secOff, int secLen, byte[] label, byte[] seed, byte[] output, byte[] pad1, byte[] pad2)
|
| private static byte[][] | |
| pack-priv static byte[] |
| B0 | back to summary |
|---|---|
| private static final byte[] B0 | |
| HMAC_ipad128 | back to summary |
|---|---|
| private static final byte[] HMAC_ipad128 | |
| HMAC_ipad64 | back to summary |
|---|---|
| private static final byte[] HMAC_ipad64 | |
| HMAC_opad128 | back to summary |
|---|---|
| private static final byte[] HMAC_opad128 | |
| HMAC_opad64 | back to summary |
|---|---|
| private static final byte[] HMAC_opad64 | |
| LABEL_CLIENT_WRITE_KEY | back to summary |
|---|---|
| pack-priv static final byte[] LABEL_CLIENT_WRITE_KEY | |
| LABEL_EXTENDED_MASTER_SECRET | back to summary |
|---|---|
| pack-priv static final byte[] LABEL_EXTENDED_MASTER_SECRET | |
| LABEL_IV_BLOCK | back to summary |
|---|---|
| pack-priv static final byte[] LABEL_IV_BLOCK | |
| LABEL_KEY_EXPANSION | back to summary |
|---|---|
| pack-priv static final byte[] LABEL_KEY_EXPANSION | |
| LABEL_MASTER_SECRET | back to summary |
|---|---|
| pack-priv static final byte[] LABEL_MASTER_SECRET | |
| LABEL_SERVER_WRITE_KEY | back to summary |
|---|---|
| pack-priv static final byte[] LABEL_SERVER_WRITE_KEY | |
| MSG | back to summary |
|---|---|
| private static final String MSG | |
| spec | back to summary |
|---|---|
| private TlsPrfParameterSpec spec
References Deprecated
See corresponding docs for further information.
| |
| SSL3_CONST | back to summary |
|---|---|
| pack-priv static final byte[][] SSL3_CONST | |
| TlsPrfGenerator | back to summary |
|---|---|
| public TlsPrfGenerator() | |
| concat | back to summary |
|---|---|
| pack-priv static byte[] concat(byte[] b1, byte[] b2) | |
| doTLS10PRF | back to summary |
|---|---|
| pack-priv static byte[] doTLS10PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength) throws NoSuchAlgorithmException, DigestException | |
| doTLS10PRF | back to summary |
|---|---|
| pack-priv static byte[] doTLS10PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength, MessageDigest md5, MessageDigest sha) throws DigestException | |
| doTLS12PRF | back to summary |
|---|---|
| pack-priv static byte[] doTLS12PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength, String prfHash, int prfHashLength, int prfBlockSize) throws NoSuchAlgorithmException, DigestException | |
| doTLS12PRF | back to summary |
|---|---|
| pack-priv static byte[] doTLS12PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength, MessageDigest mdPRF, int mdPRFLen, int mdPRFBlockSize) throws DigestException | |
| engineGenerateKey0 | back to summary |
|---|---|
| protected SecretKey engineGenerateKey0(boolean tls12) | |
| engineInit | back to summary |
|---|---|
| protected void engineInit(SecureRandom random) Implements abstract javax. Doc from javax. Initializes the key generator. | |
| engineInit | back to summary |
|---|---|
| protected void engineInit(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException Implements abstract javax. Doc from javax. Initializes the key generator with the specified parameter set and a user-provided source of randomness.
| |
| engineInit | back to summary |
|---|---|
| protected void engineInit(int keysize, SecureRandom random) Implements abstract javax. Doc from javax. Initializes this key generator for a certain keysize, using the given source of randomness. | |
| expand | back to summary |
|---|---|
| private static void expand(MessageDigest digest, int hmacSize, byte[] secret, int secOff, int secLen, byte[] label, byte[] seed, byte[] output, byte[] pad1, byte[] pad2) throws DigestException | |
| genConst | back to summary |
|---|---|
| private static byte[][] genConst() | |
| genPad | back to summary |
|---|---|
| pack-priv static byte[] genPad(byte b, int count) | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected SecretKey | engineGenerateKey()
Implements abstract javax. Generates a secret key. |
| V10 | back to summary |
|---|---|
| public V10() | |
| engineGenerateKey | back to summary |
|---|---|
| protected SecretKey engineGenerateKey() Implements abstract javax. Doc from javax. Generates a secret key. | |
TLS 1.2 uses a different hash algorithm than 1.0/1.1 for the PRF calculations. As of 2010, there is no PKCS11-level support for TLS 1.2 PRF calculations, and no known OS's have an internal variant we could use. Therefore, for TLS 1.2, we are updating JSSE to request a different provider algorithm: "SunTls12Prf". If we reused the name "SunTlsPrf", the PKCS11 provider would need be updated to fail correctly when presented with the wrong version number (via Provider.Service.supportsParameters()), and add the appropriate supportsParamters() checks into KeyGenerators (not currently there).
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected SecretKey | engineGenerateKey()
Implements abstract javax. Generates a secret key. |
| V12 | back to summary |
|---|---|
| public V12() | |
| engineGenerateKey | back to summary |
|---|---|
| protected SecretKey engineGenerateKey() Implements abstract javax. Doc from javax. Generates a secret key. | |