Sender
public
class
Sender
extends Object
| java.lang.Object | |
| ↳ | android.crypto.hpke.Sender |
A class for sending HPKE messages.
Summary
Nested classes | |
|---|---|
class |
Sender.Builder
A builder for HPKE Sender objects. |
Public methods | |
|---|---|
byte[]
|
export(int length, byte[] context)
Exports secret key material from this Sender as described in RFC 9180. |
byte[]
|
getEncapsulated()
Returns the encapsulated ephemeral key created for this Sender. |
Provider
|
getProvider()
Returns the |
HpkeSpi
|
getSpi()
Returns the |
byte[]
|
seal(byte[] plaintext, byte[] aad)
Seals a message, using the internal key schedule maintained by this Sender. |
Inherited methods | |
|---|---|
Public methods
export
public byte[] export (int length,
byte[] context)Exports secret key material from this Sender as described in RFC 9180.
| Parameters | |
|---|---|
length |
int: expected output length |
context |
byte: optional exporter context string, may be null or empty |
| Returns | |
|---|---|
byte[] |
the exported value.
This value cannot be null. |
| Throws | |
|---|---|
IllegalArgumentException |
if the length is not valid for the Sender's KDF |
getEncapsulated
public byte[] getEncapsulated ()
Returns the encapsulated ephemeral key created for this Sender.
| Returns | |
|---|---|
byte[] |
the encapsulated key.
This value cannot be null. |
getProvider
public Provider getProvider ()
Returns the Provider being used by this Sender.
| Returns | |
|---|---|
Provider |
the Provider.
This value cannot be null. |
getSpi
public HpkeSpi getSpi ()
Returns the HpkeSpi being used by this Sender.
| Returns | |
|---|---|
HpkeSpi |
the SPI.
This value cannot be null. |
seal
public byte[] seal (byte[] plaintext,
byte[] aad)Seals a message, using the internal key schedule maintained by this Sender.
| Parameters | |
|---|---|
plaintext |
byte: the plaintext.
This value cannot be null. |
aad |
byte: optional additional authenticated data, may be null or empty |
| Returns | |
|---|---|
byte[] |
the ciphertext.
This value cannot be null. |
See also:
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-13 UTC.