Builder


open class Builder
kotlin.Any
   ↳ android.crypto.hpke.Sender.Builder

A builder for HPKE Sender objects.

Summary

Public constructors
Builder(hpke: Hpke, recipientKey: PublicKey)

Creates the Builder.

Public methods
open Sender

Created the Sender object.

open Sender.Builder
setApplicationInfo(applicationInfo: ByteArray)

Adds optional application-related data which will be used during the key generation process.

open Sender.Builder
setPsk(psk: ByteArray, pskId: ByteArray)

Sets pre-shared key information to be used for message authentication.

open Sender.Builder

Sets the sender key to be used by the recipient for message authentication.

Public constructors

Builder

Builder(
    hpke: Hpke,
    recipientKey: PublicKey)

Creates the Builder.

Parameters
hpke Hpke: This value cannot be null.
recipientKey PublicKey: public key of the recipient.
This value cannot be null.

Public methods

build

open fun build(): Sender

Created the Sender object.

Return
Sender This value cannot be null.
Exceptions
java.lang.UnsupportedOperationException if this Provider does not support the expected mode
java.security.InvalidKeyException if the sender or recipient key are unsupported

setApplicationInfo

open fun setApplicationInfo(applicationInfo: ByteArray): Sender.Builder

Adds optional application-related data which will be used during the key generation process.

Parameters
applicationInfo ByteArray: application-specific information.
This value cannot be null.
Return
Sender.Builder the Builder.
This value cannot be null.

setPsk

open fun setPsk(
    psk: ByteArray,
    pskId: ByteArray
): Sender.Builder

Sets pre-shared key information to be used for message authentication.

Parameters
psk ByteArray: the pre-shared secret key.
This value cannot be null.
pskId ByteArray: the id of the pre-shared key.
This value cannot be null.
Return
Sender.Builder the Builder.
This value cannot be null.

setSenderKey

open fun setSenderKey(senderKey: PrivateKey): Sender.Builder

Sets the sender key to be used by the recipient for message authentication.

Parameters
senderKey PrivateKey: the sender's public key.
This value cannot be null.
Return
Sender.Builder the Builder.
This value cannot be null.