public abstract class HpkeContext
Base class for HPKE sender and recipient contexts.
This is the client API for HPKE usage, all operations are delegated to an implementation class implementing HpkeSpi which is located using the JCA Provider mechanism.
The implementation maintains the context for an HPKE exchange, including the key schedule
to use for seal and open operations.
Secret key material based on the context may also be generated and exported as per RFC 9180.
See: RFC 9180 (HPKE)
public byte[] export(int length, byte[] context)
| Parameters | |
|---|---|
| length | expected output length |
| context | optional context string, may be null or empty |
| Returns | |
| byte[] | exported value |
| Throws | |
| IllegalArgumentException | if the length is not valid for the KDF in use |
| IllegalStateException | if this HpkeContext has not been initialised |
public HpkeSpi getSpi()
| Returns | |
|---|---|
| org.conscrypt.HpkeSpi | the SPI |