Class 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 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 interface BlockCrypto
        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 interface BlockCrypto
        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 interface BlockCrypto
        Parameters:
        key - The EncryptionKey to use when decrypting the Block.
        bytes - The encrypted serialized form of the Block.
        Returns:
        The serialzied Block.