| Modifier and Type | Class and Description |
|---|---|
static class |
PseudoRandomFunction.Label |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
doPRF(Mac hmac,
SecretKey secret,
PseudoRandomFunction.Label label,
byte[] seed)
Does the pseudo random function as defined in
RFC 5246.
|
static byte[] |
doPRF(Mac hmac,
SecretKey secret,
PseudoRandomFunction.Label label,
byte[] seed,
int length)
Does the pseudo random function as defined in RFC 5246.
|
static SecretKey |
generateMasterSecret(Mac hmac,
SecretKey premasterSecret,
byte[] seed)
Generate master secret.
|
static SecretKey |
generatePremasterSecretFromPSK(SecretKey otherSecret,
SecretKey pskSecret)
The premaster secret is formed as follows: if the PSK is N octets long,
concatenate a uint16 with the value N, N zero octets, a second uint16
with the value N, and the PSK itself.
|
public static final byte[] doPRF(Mac hmac, SecretKey secret, PseudoRandomFunction.Label label, byte[] seed)
hmac - MAC algorithm. e.g. HmacSHA256secret - the secret to use for the secure hash functionlabel - the label to use for creating the original data. Uses the
length from the label.seed - the seed to use for creating the original datapublic static final byte[] doPRF(Mac hmac, SecretKey secret, PseudoRandomFunction.Label label, byte[] seed, int length)
hmac - MAC algorithm. e.g. HmacSHA256secret - the secret to use for the secure hash functionlabel - the label to use for creating the original dataseed - the seed to use for creating the original datalength - the length of data to createpublic static SecretKey generateMasterSecret(Mac hmac, SecretKey premasterSecret, byte[] seed)
hmac - MAC algorithm. e.g. HmacSHA256premasterSecret - the secret to use for the secure hash functionseed - the seed to use for creating the original datapublic static SecretKey generatePremasterSecretFromPSK(SecretKey otherSecret, SecretKey pskSecret)
otherSecret - either is zeroes (plain PSK case) or comes from the
EC Diffie-Hellman exchange (ECDHE_PSK).pskSecret - PSK secret.Copyright © 2023 Eclipse Foundation. All rights reserved.