@Immutable public final class InsecureNonceChaCha20Poly1305Jce extends Object
It is similar to ChaCha20Poly1305Jce, but it offers an interface for the user to
choose the nonce, which is needed in HPKE.
It uses the JCE, and requires that algorithm "ChaCha20-Poly1305" is present.
| Modifier and Type | Method and Description |
|---|---|
static InsecureNonceChaCha20Poly1305Jce |
create(byte[] key) |
byte[] |
decrypt(byte[] nonce,
byte[] ciphertext,
byte[] associatedData) |
byte[] |
encrypt(byte[] nonce,
byte[] plaintext,
byte[] associatedData) |
static boolean |
isSupported() |
public static InsecureNonceChaCha20Poly1305Jce create(byte[] key) throws GeneralSecurityException
GeneralSecurityExceptionpublic static boolean isSupported()
public byte[] encrypt(byte[] nonce,
byte[] plaintext,
byte[] associatedData)
throws GeneralSecurityException
GeneralSecurityExceptionpublic byte[] decrypt(byte[] nonce,
byte[] ciphertext,
byte[] associatedData)
throws GeneralSecurityException
GeneralSecurityException