Class FileEncryptionPropertiesBuilder
- Namespace
- ParquetSharp
- Assembly
- ParquetSharp.dll
Builder pattern for creating and configuring a FileEncryptionProperties object. Provides a fluent API for setting the encryption properties (footer key, encryption algorithm, etc.) for a Parquet file.
public sealed class FileEncryptionPropertiesBuilder : IDisposable
- Inheritance
-
FileEncryptionPropertiesBuilder
- Implements
- Inherited Members
Constructors
FileEncryptionPropertiesBuilder(byte[])
Create a new FileEncryptionPropertiesBuilder with a footer key.
public FileEncryptionPropertiesBuilder(byte[] footerKey)
Parameters
footerKey
byte[]An array of bytes used to encrypt the footer.
Methods
AadPrefix(string)
Set the additional authenticated data (AAD) prefix.
public FileEncryptionPropertiesBuilder AadPrefix(string aadPrefix)
Parameters
aadPrefix
stringA string representing the AAD prefix.
Returns
- FileEncryptionPropertiesBuilder
This builder instance.
Algorithm(ParquetCipher)
Set the encryption algorithm.
public FileEncryptionPropertiesBuilder Algorithm(ParquetCipher parquetCipher)
Parameters
parquetCipher
ParquetCipherA ParquetCipher value representing the encryption algorithm.
Returns
- FileEncryptionPropertiesBuilder
This builder instance.
Build()
Build the FileEncryptionProperties object.
public FileEncryptionProperties Build()
Returns
- FileEncryptionProperties
The configured FileEncryptionProperties object.
DisableAadPrefixStorage()
Disable AAD prefix storage in the file.
public FileEncryptionPropertiesBuilder DisableAadPrefixStorage()
Returns
- FileEncryptionPropertiesBuilder
This builder instance.
Remarks
Disabling AAD prefix storage will prevent the AAD prefix from being stored in the file.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EncryptedColumns(ColumnEncryptionProperties[])
Set which columns in the Parquet file to encrypt.
public FileEncryptionPropertiesBuilder EncryptedColumns(ColumnEncryptionProperties[] columnEncryptionProperties)
Parameters
columnEncryptionProperties
ColumnEncryptionProperties[]An array of ColumnEncryptionProperties objects representing the columns to be encrypted.
Returns
- FileEncryptionPropertiesBuilder
This builder instance.
FooterKeyId(string)
Set the key ID associated to the footer key.
public FileEncryptionPropertiesBuilder FooterKeyId(string footerKeyId)
Parameters
footerKeyId
stringA unique identifier for the footer key.
Returns
- FileEncryptionPropertiesBuilder
This builder instance.
Remarks
Key IDs help identify and manage encryption keys, helpful when multiple keys are in use. This value is typically stored in key management systems.
FooterKeyMetadata(string)
Set the metadata for the footer key.
public FileEncryptionPropertiesBuilder FooterKeyMetadata(string footerKeyMetadata)
Parameters
footerKeyMetadata
stringA string containing metadata for the footer key.
Returns
- FileEncryptionPropertiesBuilder
This builder instance.
SetPlaintextFooter()
Set the footer to be in plaintext, i.e., not encrypted.
public FileEncryptionPropertiesBuilder SetPlaintextFooter()
Returns
- FileEncryptionPropertiesBuilder
This builder instance.