Class NoOpBlockCrypto
- java.lang.Object
-
- com.amazonaws.athena.connector.lambda.security.NoOpBlockCrypto
-
- All Implemented Interfaces:
BlockCrypto
public class NoOpBlockCrypto extends Object implements BlockCrypto
Implementation of BlockCrypto does a No-OP (nothing) for encrypting and decrypting blocks. This is helpful when you want to disable encryption or do testing without having to handle disabled encryption as a special case in code.- See Also:
BlockCrypto
-
-
Constructor Summary
Constructors Constructor Description NoOpBlockCrypto(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.
-
-
-
Constructor Detail
-
NoOpBlockCrypto
public NoOpBlockCrypto(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.
-
-