Class EnvelopeCrypto

java.lang.Object
com.helixframework.aws.encryption.EnvelopeCrypto

public class EnvelopeCrypto extends Object
Utility for doing envelope encryption with AWS Encryption SDK.
  • Method Details

    • builder

      public static EnvelopeCrypto.Builder builder()
      Gets a builder for creating instances of EnvelopeCrypto.
      Returns:
      builder
    • encrypt

      public byte[] encrypt(byte[] plaintext)
      Encrypts the supplied plaintext data.
      Parameters:
      plaintext - data to encrypt
      Returns:
      encrypted data
    • encrypt

      public byte[] encrypt(Map<String,String> context, byte[] plaintext)
      Encrypts the supplied plaintext data with encryption context.
      Parameters:
      context - encryption context
      plaintext - data to encrypt
      Returns:
      encrypted data
    • encrypt

      public String encrypt(String plaintext)
      Encrypts the supplied plaintext data.
      Parameters:
      plaintext - data to encrypt
      Returns:
      encrypted data
    • encrypt

      public String encrypt(Map<String,String> context, String plaintext)
      Encrypts the supplied plaintext data with encryption context.
      Parameters:
      context - encryption context
      plaintext - data to encrypt
      Returns:
      encrypted data
    • decrypt

      public byte[] decrypt(byte[] ciphertext)
      Decrypts the supplied ciphertext bytes.
      Parameters:
      ciphertext - data to decrypt
      Returns:
      decrypted data
    • decrypt

      public byte[] decrypt(Map<String,String> context, byte[] ciphertext)
      Decrypts the supplied ciphertext and verifies that the supplied encryption context matches the context with which the data was encrypted.
      Parameters:
      context - encryption context
      ciphertext - data to decrypt
      Returns:
      decrypted data
    • decrypt

      public String decrypt(String ciphertext)
      Decrypts the supplied ciphertext bytes.
      Parameters:
      ciphertext - data to decrypt
      Returns:
      decrypted data
    • decrypt

      public String decrypt(Map<String,String> context, String ciphertext)
      Decrypts the supplied ciphertext and verifies that the supplied encryption context matches the context with which the data was encrypted.
      Parameters:
      context - encryption context
      ciphertext - data to decrypt
      Returns:
      decrypted data