Source: factory.core/ObjEncryption.py
| Method | Signature | Description |
|---|---|---|
| encode_table | encode_table(table: str = '', crypt_cols: list[str] | None = None, key_cols: list[str] | None = None) |
|
| encode_tables | encode_tables(package: str = '') |
|
| provision | provision(package = '') |
|
| load_public_key | load_public_key(package: str) |
Load and cache public key for a package with TTL. |
| load_private_key | load_private_key(package: str) |
Load and cache private key for a package with TTL. |
| clear_key_cache | clear_key_cache(package: str = None) |
Clear encryption key cache for a package or all packages. |
| encrypt_text | encrypt_text(message: str, package: str) -> str |
Encrypt a message using RSA public key encryption. |
| decrypt_text | decrypt_text(ciphertext: str, package: str) -> str |
Decrypt a message using RSA private key decryption. |
| has_private_key | has_private_key(package = '') -> bool |
Check if a private key is available. |
| has_public_key | has_public_key(package = '') -> bool |
Check if a public key is available. |
| generate_key | generate_key(package = 'base') |
|
| get_public_key_text | get_public_key_text(package = '') -> str |
Return public key PEM text for a package. |
| save_public_key | save_public_key(public_key, filename: str = '', package: str = 'base') |
|
| save_key | save_key(private_key, filename: str = '', package: str = 'base') |
|
| encrypt | encrypt(message: str, package = '') -> str |
|
| decrypt | decrypt(message: str, package = '') -> str |
Encrypts the given text using the specified package's key.
Decrypts the given text using the specified package's key.
Provisions encryption keys for the specified package.
Encrypts all columns in all tables as defined in the configuration.