public interface TlsSecret
Modifier and Type | Method and Description |
---|---|
TlsSecret |
deriveUsingPRF(int prfAlgorithm,
java.lang.String label,
byte[] seed,
int length)
Return a new secret based on applying a PRF to this one.
|
void |
destroy()
Destroy the internal state of the secret.
|
byte[] |
encrypt(TlsCertificate certificate)
Return the an encrypted copy of the data this secret is based on.
|
byte[] |
extract()
Return the internal data from this secret.
|
TlsSecret |
hkdfExpand(short hashAlgorithm,
byte[] info,
int length)
RFC 5869 HKDF-Expand function, with this secret's data as the pseudo-random key ('prk').
|
TlsSecret |
hkdfExtract(short hashAlgorithm,
byte[] ikm)
RFC 5869 HKDF-Extract function, with this secret's data as the 'salt'.
|
boolean |
isAlive() |
TlsSecret deriveUsingPRF(int prfAlgorithm, java.lang.String label, byte[] seed, int length)
prfAlgorithm
- PRF algorithm to use.label
- the label details.seed
- the seed details.length
- the size (in bytes) of the secret to generate.void destroy()
TlsSecret
will result in an IllegalStateException
being thrown.byte[] encrypt(TlsCertificate certificate) throws java.io.IOException
certificate
- the certificate containing the public key to use for protecting the internal data.java.io.IOException
byte[] extract()
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.TlsSecret hkdfExpand(short hashAlgorithm, byte[] info, int length)
hashAlgorithm
- the hash algorithm to instantiate HMAC with. See HashAlgorithm
for values.info
- optional context and application specific information (can be zero-length).length
- length of output keying material in octets.TlsSecret hkdfExtract(short hashAlgorithm, byte[] ikm)
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.hashAlgorithm
- the hash algorithm to instantiate HMAC with. See HashAlgorithm
for values.ikm
- input keying material.boolean isAlive()