Package com.helixframework.crypto.aead
Class AeadCrypto
java.lang.Object
com.helixframework.crypto.aead.AeadCrypto
AEAD crypto using keyset from local machine.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]decrypt(byte[] data) Decrypts bytes with no associated data.byte[]decrypt(byte[] data, byte[] associatedData) Decrypts bytes with associated data.byte[]Decrypts bytes with associated data.Decrypts a string with associated data.Decrypts a string with no associated data.Decrypts a string with associated data.byte[]encrypt(byte[] data) Encrypts bytes with no associated data.byte[]encrypt(byte[] data, byte[] associatedData) Encrypts bytes with associated data.byte[]Encrypts bytes with associated data.Encrypts a string with associated data.Encrypts a string with no associated data.Encrypts a string with associated data.
-
Method Details
-
encrypt
Encrypts bytes with no associated data.- Parameters:
data- data to encrypt- Returns:
- encrypted bytes
- Throws:
GeneralSecurityException- if encryption fails
-
encrypt
public byte[] encrypt(byte[] data, Map<String, Object> associatedData) throws GeneralSecurityExceptionEncrypts bytes with associated data.- Parameters:
data- data to encryptassociatedData- plaintext associated data- Returns:
- encrypted bytes
- Throws:
GeneralSecurityException- if encryption fails
-
encrypt
Encrypts bytes with associated data.- Parameters:
data- data to encryptassociatedData- plaintext associated data- Returns:
- encrypted bytes
- Throws:
GeneralSecurityException- if encryption fails
-
encrypt
Encrypts a string with no associated data.- Parameters:
data- string to encryptcharset- string character set- Returns:
- encrypted string
- Throws:
GeneralSecurityException- if encryption fails
-
encrypt
public String encrypt(String data, Map<String, Object> associatedData, Charset charset) throws GeneralSecurityExceptionEncrypts a string with associated data.- Parameters:
data- data to encryptassociatedData- plaintext associated datacharset- string character set- Returns:
- encrypted string
- Throws:
GeneralSecurityException- if encryption fails
-
encrypt
public String encrypt(String data, String associatedData, Charset charset) throws GeneralSecurityException Encrypts a string with associated data.- Parameters:
data- string to encryptassociatedData- plaintext associated datacharset- string character set- Returns:
- encrypted string
- Throws:
GeneralSecurityException- if encryption fails
-
decrypt
Decrypts bytes with no associated data.- Parameters:
data- bytes to decrypt- Returns:
- decrypted bytes
- Throws:
GeneralSecurityException- if decryption fails
-
decrypt
public byte[] decrypt(byte[] data, Map<String, Object> associatedData) throws GeneralSecurityExceptionDecrypts bytes with associated data.- Parameters:
data- bytes to decryptassociatedData- plaintext associated data- Returns:
- decrypted bytes
- Throws:
GeneralSecurityException- if decryption fails
-
decrypt
Decrypts bytes with associated data.- Parameters:
data- bytes to decryptassociatedData- plaintext associated data- Returns:
- decrypted bytes
- Throws:
GeneralSecurityException- if decryption fails
-
decrypt
Decrypts a string with no associated data.- Parameters:
data- string to decryptcharset- string character set- Returns:
- decrypted string
- Throws:
GeneralSecurityException- if decryption fails
-
decrypt
public String decrypt(String data, Map<String, Object> associatedData, Charset charset) throws GeneralSecurityExceptionDecrypts a string with associated data.- Parameters:
data- string to decryptassociatedData- plaintext associated datacharset- string character set- Returns:
- decrypted string
- Throws:
GeneralSecurityException- if decryption fails
-
decrypt
public String decrypt(String data, String associatedData, Charset charset) throws GeneralSecurityException Decrypts a string with associated data.- Parameters:
data- string to decryptassociatedData- plaintext associated datacharset- string character set- Returns:
- decrypted string
- Throws:
GeneralSecurityException- if decryption fails
-