keys
๐ค AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
flavor.packaging.keys
¶
Key management for FlavorPack package signing.
Functions¶
generate_key_pair
¶
Generates a new Ed25519 key pair and saves them to PEM files.
This function is used for CLI operations where keys need to be persisted to files for later use. For internal package building where keys are used immediately and discarded, use flavor.psp.format_2025.crypto.generate_key_pair() which returns raw bytes instead.
Ed25519 is used for all PSPF packages as specified in the PSPF/2025 format. This provides: - Small keys (32 bytes public, 32 bytes private seed) - Fast signing and verification - Deterministic signatures - Strong security with no parameters to misconfigure
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keys_dir
|
Path
|
Directory to save the key files |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[Path, Path]
|
(private_key_path, public_key_path) |
See Also
flavor.psp.format_2025.crypto.generate_key_pair: For in-memory key generation
Source code in flavor/packaging/keys.py
load_private_key_raw
¶
Load a private key from PEM file and return raw 32-byte seed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_path
|
Path
|
Path to PEM-encoded private key file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
Raw 32-byte private key seed for Ed25519 |
Source code in flavor/packaging/keys.py
load_public_key_raw
¶
Load a public key from PEM file and return raw 32-byte key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key_path
|
Path
|
Path to PEM-encoded public key file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bytes |
bytes
|
Raw 32-byte public key for Ed25519 |