[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/crypto/hpke/Sender [Back]  [Original]

Sender  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.

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 Provider being used by this Sender.

HpkeSpi getSpi()

Returns the HpkeSpi being used by this Sender.

byte[] seal(byte[] plaintext, byte[] aad)

Seals a message, using the internal key schedule maintained by this Sender.

Inherited methods

Public methods

export

Added in API level 37
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

Added in API level 37
public byte[] getEncapsulated ()

Returns the encapsulated ephemeral key created for this Sender.

Returns
byte[] the encapsulated key.
This value cannot be null.

getProvider

Added in API level 37
public Provider getProvider ()

Returns the Provider being used by this Sender.

Returns
Provider the Provider.
This value cannot be null.

getSpi

Added in API level 37
public HpkeSpi getSpi ()

Returns the HpkeSpi being used by this Sender.

Returns
HpkeSpi the SPI.
This value cannot be null.

seal

Added in API level 37
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-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page