![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Decrypts Parquet modules using the keys from an EncryptionConfig. More...
#include <pme.hpp>
Public Member Functions | |
| FileDecryptor (const EncryptionConfig &config) | |
| Construct a decryptor from an encryption configuration. | |
| expected< std::vector< uint8_t > > | decrypt_footer (const uint8_t *encrypted_footer, size_t size) const |
| Decrypt the encrypted FileMetaData (footer). | |
| expected< std::vector< uint8_t > > | decrypt_column_page (const uint8_t *encrypted_page, size_t size, const std::string &column_name, int32_t row_group_ordinal, int32_t page_ordinal) const |
| Decrypt a column data page (AES-GCM or AES-CTR depending on algorithm). | |
| expected< std::vector< uint8_t > > | decrypt_column_metadata (const uint8_t *encrypted_metadata, size_t size, const std::string &column_name) const |
| Decrypt serialized ColumnMetaData (always AES-GCM authenticated). | |
| expected< std::vector< uint8_t > > | decrypt_dict_page (const uint8_t *encrypted_page, size_t size, const std::string &column_name, int32_t row_group_ordinal) const |
| Decrypt a dictionary page. | |
| expected< std::vector< uint8_t > > | decrypt_data_page_header (const uint8_t *encrypted_header, size_t size, const std::string &column_name, int32_t row_group_ordinal, int32_t page_ordinal) const |
| Decrypt a data page header (always AES-GCM authenticated). | |
| expected< std::vector< uint8_t > > | decrypt_column_meta_header (const uint8_t *encrypted_header, size_t size, const std::string &column_name) const |
| Decrypt a column metadata header (always AES-GCM authenticated). | |
| expected< void > | unwrap_keys (const std::vector< std::pair< std::string, std::vector< uint8_t > > > &wrapped_keys) |
| Unwrap DEKs from wrapped blobs using the configured KMS client. | |
| expected< std::vector< uint8_t > > | verify_footer_signature (const uint8_t *signed_footer, size_t size) const |
| Verify a signed plaintext footer and return the original footer data. | |
| const EncryptionConfig & | config () const |
| Access the underlying EncryptionConfig. | |
Decrypts Parquet modules using the keys from an EncryptionConfig.
The config must contain the same keys that were used for encryption. For EXTERNAL mode, the caller is responsible for resolving KMS key IDs to actual key bytes before constructing the config.
Usage: FileDecryptor dec(cfg); auto footer = dec.decrypt_footer(encrypted_footer, footer_size); auto page = dec.decrypt_column_page(encrypted_page, page_size, "price", 0, 0);
|
inlineexplicit |
|
inline |
Access the underlying EncryptionConfig.
|
inline |
Decrypt a column metadata header (always AES-GCM authenticated).
| encrypted_header | Pointer to encrypted column metadata header. |
| size | Total encrypted size. |
| column_name | Column path for key resolution and AAD. |
|
inline |
Decrypt serialized ColumnMetaData (always AES-GCM authenticated).
| encrypted_metadata | Pointer to encrypted metadata bytes. |
| size | Total encrypted size. |
| column_name | Column path for key resolution and AAD. |
|
inline |
Decrypt a column data page (AES-GCM or AES-CTR depending on algorithm).
| encrypted_page | Pointer to encrypted page bytes. |
| size | Total encrypted size. |
| column_name | Column path for key resolution and AAD. |
| row_group_ordinal | Row group index (for AAD reconstruction). |
| page_ordinal | Page index (for AAD reconstruction). |
|
inline |
Decrypt a data page header (always AES-GCM authenticated).
| encrypted_header | Pointer to encrypted page header bytes. |
| size | Total encrypted size. |
| column_name | Column path for key resolution and AAD. |
| row_group_ordinal | Row group index (for AAD reconstruction). |
| page_ordinal | Page index (for AAD reconstruction). |
|
inline |
Decrypt a dictionary page.
| encrypted_page | Pointer to encrypted dictionary page bytes. |
| size | Total encrypted size. |
| column_name | Column path for key resolution and AAD. |
| row_group_ordinal | Row group index (for AAD reconstruction). |
|
inline |
Decrypt the encrypted FileMetaData (footer).
Reads the IV from the header, then decrypts with AES-GCM.
| encrypted_footer | Pointer to encrypted footer bytes. |
| size | Total size including IV header and GCM tag. |
|
inline |
Unwrap DEKs from wrapped blobs using the configured KMS client.
Call this before decrypt_footer / decrypt_column_page when using EXTERNAL key mode. Populates the internal config with unwrapped keys.
| wrapped_keys | List of (key_id, wrapped_dek) pairs from file metadata. |
|
inline |
Verify a signed plaintext footer and return the original footer data.
| signed_footer | Pointer to footer bytes with appended 32-byte HMAC. |
| size | Total size including the 32-byte signature. |