Builder
open class Builder
| kotlin.Any | |
| ↳ | android.crypto.hpke.Recipient.Builder |
A builder for HPKE Recipient objects.
Summary
| Public constructors | |
|---|---|
Builder(hpke: Hpke, encapsulated: ByteArray, recipientKey: PrivateKey)Creates the builder. |
|
| Public methods | |
|---|---|
| open Recipient |
build()Builds the |
| open Recipient.Builder |
setApplicationInfo(applicationInfo: ByteArray)Adds optional application-related data which will be used during the key generation process. |
| open Recipient.Builder |
Sets pre-shared key information to be used for message authentication. |
| open Recipient.Builder |
setSenderKey(senderKey: PublicKey)Sets the sender key to be used by the recipient for message authentication. |
Public constructors
Builder
Builder(
hpke: Hpke,
encapsulated: ByteArray,
recipientKey: PrivateKey)
Creates the builder.
| Parameters | |
|---|---|
hpke |
Hpke: This value cannot be null. |
encapsulated |
ByteArray: encapsulated ephemeral key from an Sender This value cannot be null. |
recipientKey |
PrivateKey: private key of the recipient. This value cannot be null. |
Public methods
build
open fun build(): Recipient
Builds the Recipient.
| Return | |
|---|---|
Recipient |
the Recipient. 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): Recipient.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 | |
|---|---|
Recipient.Builder |
the Builder. This value cannot be null. |
setPsk
open fun setPsk(
psk: ByteArray,
pskId: ByteArray
): Recipient.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 | |
|---|---|
Recipient.Builder |
the Builder. This value cannot be null. |
setSenderKey
open fun setSenderKey(senderKey: PublicKey): Recipient.Builder
Sets the sender key to be used by the recipient for message authentication.
| Parameters | |
|---|---|
senderKey |
PublicKey: the sender's public key. This value cannot be null. |
| Return | |
|---|---|
Recipient.Builder |
the Builder. This value cannot be null. |