Class AesGcmBlockCrypto
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.security.AesGcmBlockCrypto
-
- All Implemented Interfaces:
BlockCrypto
public class AesGcmBlockCrypto extends Object implements BlockCrypto
Implementation of BlockCrypto which uses AES-GCM for encrypting and decrypting blocks.- See Also:
BlockCrypto
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
ALGO
protected static String
ALGO_BC
protected static int
GCM_TAG_LENGTH_BITS
protected static int
KEY_BYTES
protected static String
KEYSPEC
protected static int
NONCE_BYTES
-
Constructor Summary
Constructors Constructor Description AesGcmBlockCrypto(BlockAllocator allocator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decrypt(EncryptionKey key, byte[] bytes)
Used to decrypt a Block's serialzied form.Block
decrypt(EncryptionKey key, byte[] bytes, org.apache.arrow.vector.types.pojo.Schema schema)
Used to decrypt and deserialize a Block from the provided bytes and schema.byte[]
encrypt(EncryptionKey key, Block block)
Used to encrypt the provided Block in its serialized form.
-
-
-
Field Detail
-
GCM_TAG_LENGTH_BITS
protected static final int GCM_TAG_LENGTH_BITS
- See Also:
- Constant Field Values
-
NONCE_BYTES
protected static final int NONCE_BYTES
- See Also:
- Constant Field Values
-
KEY_BYTES
protected static final int KEY_BYTES
- See Also:
- Constant Field Values
-
KEYSPEC
protected static final String KEYSPEC
- See Also:
- Constant Field Values
-
ALGO
protected static final String ALGO
- See Also:
- Constant Field Values
-
ALGO_BC
protected static final String ALGO_BC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AesGcmBlockCrypto
public AesGcmBlockCrypto(BlockAllocator allocator)
-
-
Method Detail
-
encrypt
public byte[] encrypt(EncryptionKey key, Block block)
Description copied from interface:BlockCrypto
Used to encrypt the provided Block in its serialized form.- Specified by:
encrypt
in interfaceBlockCrypto
- Parameters:
key
- The EncryptionKey to use when encrypting the Block.block
- The Block to serialize and encrypt.- Returns:
- The encrypted byte[] representation of the serialized Block, excluding its Schema.
-
decrypt
public Block decrypt(EncryptionKey key, byte[] bytes, org.apache.arrow.vector.types.pojo.Schema schema)
Description copied from interface:BlockCrypto
Used to decrypt and deserialize a Block from the provided bytes and schema.- Specified by:
decrypt
in interfaceBlockCrypto
- Parameters:
key
- The EncryptionKey to use when decrypting the Block.bytes
- The encrypted serialized form of the Block.schema
- The schema of the encrypted block- Returns:
- The Block.
-
decrypt
public byte[] decrypt(EncryptionKey key, byte[] bytes)
Description copied from interface:BlockCrypto
Used to decrypt a Block's serialzied form.- Specified by:
decrypt
in interfaceBlockCrypto
- Parameters:
key
- The EncryptionKey to use when decrypting the Block.bytes
- The encrypted serialized form of the Block.- Returns:
- The serialzied Block.
-
-