Sender.Builder
public
static
class
Sender.Builder
extends Object
| java.lang.Object | |
| ↳ | android.crypto.hpke.Sender.Builder |
A builder for HPKE Sender objects.
Summary
Public constructors | |
|---|---|
Builder(Hpke hpke, PublicKey recipientKey)
Creates the Builder. |
|
Public methods | |
|---|---|
Sender
|
build()
Created the |
Sender.Builder
|
setApplicationInfo(byte[] applicationInfo)
Adds optional application-related data which will be used during the key generation process. |
Sender.Builder
|
setPsk(byte[] psk, byte[] pskId)
Sets pre-shared key information to be used for message authentication. |
Sender.Builder
|
setSenderKey(PrivateKey senderKey)
Sets the sender key to be used by the recipient for message authentication. |
Inherited methods | |
|---|---|
Public constructors
Builder
public Builder (Hpke hpke, PublicKey recipientKey)
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
public Sender build ()
Created the Sender object.
| Returns | |
|---|---|
Sender |
This value cannot be null. |
| Throws | |
|---|---|
UnsupportedOperationException |
if this Provider does not support the expected mode |
InvalidKeyException |
if the sender or recipient key are unsupported |
setApplicationInfo
public Sender.Builder setApplicationInfo (byte[] applicationInfo)
Adds optional application-related data which will be used during the key generation process.
| Parameters | |
|---|---|
applicationInfo |
byte: application-specific information.
This value cannot be null. |
| Returns | |
|---|---|
Sender.Builder |
the Builder.
This value cannot be null. |
setPsk
public Sender.Builder setPsk (byte[] psk, byte[] pskId)
Sets pre-shared key information to be used for message authentication.
| Parameters | |
|---|---|
psk |
byte: the pre-shared secret key.
This value cannot be null. |
pskId |
byte: the id of the pre-shared key.
This value cannot be null. |
| Returns | |
|---|---|
Sender.Builder |
the Builder.
This value cannot be null. |
setSenderKey
public Sender.Builder setSenderKey (PrivateKey senderKey)
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. |
| Returns | |
|---|---|
Sender.Builder |
the Builder.
This value cannot be null. |