Package org.apache.parquet.crypto
Class FileDecryptionProperties.Builder
java.lang.Object
org.apache.parquet.crypto.FileDecryptionProperties.Builder
- Enclosing class:
- FileDecryptionProperties
-
Method Summary
Modifier and TypeMethodDescriptionbuild()withAADPrefix(byte[] aadPrefixBytes) Explicitly supply the file AAD prefix.withAADPrefixVerifier(AADPrefixVerifier aadPrefixVerifier) Set callback for verification of AAD Prefixes stored in file.withColumnKeys(Map<org.apache.parquet.hadoop.metadata.ColumnPath, ColumnDecryptionProperties> columnProperties) Set explicit column keys (decryption properties).withFooterKey(byte[] footerKey) Set an explicit footer key.withKeyRetriever(DecryptionKeyRetriever keyRetriever) Set a key retriever callback.Skip integrity verification of plaintext footers.By default, reading plaintext (unencrypted) files is not allowed when using a decryptor - in order to detect files that were not encrypted by mistake.
-
Method Details
-
withColumnKeys
public FileDecryptionProperties.Builder withColumnKeys(Map<org.apache.parquet.hadoop.metadata.ColumnPath, ColumnDecryptionProperties> columnProperties) Set explicit column keys (decryption properties). Its also possible to set a key retriever on this file decryption properties object. Upon reading, availability of explicit keys is checked before invocation of the retriever callback. If an explicit key is available for a footer or a column, its key metadata will be ignored.- Parameters:
columnProperties- Explicit column decryption keys- Returns:
- Builder
-
withKeyRetriever
Set a key retriever callback. It is also possible to set explicit footer or column keys on this file property object. Upon file decryption, availability of explicit keys is checked before invocation of the retriever callback. If an explicit key is available for a footer or a column, its key metadata will be ignored.- Parameters:
keyRetriever- Key retriever object- Returns:
- Builder
-
withAADPrefix
Explicitly supply the file AAD prefix. A must when a prefix is used for file encryption, but not stored in file. If AAD prefix is stored in file, it will be compared to the explicitly supplied value and an exception will be thrown if they differ.- Parameters:
aadPrefixBytes- AAD Prefix- Returns:
- Builder
-
withAADPrefixVerifier
Set callback for verification of AAD Prefixes stored in file.- Parameters:
aadPrefixVerifier- AAD prefix verification object- Returns:
- Builder
-
withPlaintextFilesAllowed
By default, reading plaintext (unencrypted) files is not allowed when using a decryptor - in order to detect files that were not encrypted by mistake. However, the default behavior can be overriden by calling this method. The caller should use then a different method to ensure encryption of files with sensitive data.- Returns:
- Builder
-
build