No project description provided
Project description
ash-kms
The library provides functionality to handle GCP KMS encryption keys and operations
- The library allows the creation of a new key-ring within GCP KMS.
- The library allows the creation of a new encryption key within GCP KMS.
- The library provides functionality to encrypt secrets using the specified encryption key.
- Users can decrypt secrets using the specified encryption key.
Installation
pip install ash-kms
Usage
from ash_kms import EncryptionService
key_ring_id = "test_key_ring_id"
key_id = "test_key"
location_id = "global"
plaintext = "asdf1234"
service = EncryptionService(project_id="ash-dev-273120")
key_ring_name = service.create_key_ring(location_id=location_id, key_ring_id=key_ring_id)
print(key_ring_name)
key = service.create_key_symmetric_encrypt_decrypt(location_id=location_id, key_ring_id=key_ring_id, key_id=key_id)
print(key.name)
ciphertext = service.encrypt_symmetric(location_id=location_id, key_ring_id=key_ring_id, key_id=key_id,
plaintext=plaintext)
print(f"{ciphertext=}")
decrypted_plaintext = service.decrypt_symmetric(location_id=location_id, key_ring_id=key_ring_id, key_id=key_id,
ciphertext=ciphertext)
print(f"{plaintext=}")
assert decrypted_plaintext == plaintext
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ash_kms-0.1.3.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ash_kms-0.1.3.tar.gz.
File metadata
- Download URL: ash_kms-0.1.3.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.11.14 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb245a2e94a98b909c30c470f60ac6b7199ea57ea61cb531c8a717a51805d2c7
|
|
| MD5 |
94df9a84d8acf79baa73a98d310c954c
|
|
| BLAKE2b-256 |
b0cd90c767d32ff6a8290860ebefed276d39cb58b40553ecda34de434ea5f9cf
|
File details
Details for the file ash_kms-0.1.3-py3-none-any.whl.
File metadata
- Download URL: ash_kms-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.11.14 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8fb4efbb319030ac0779360109c1abd3e8035dd13dad9ea2f4909cc03ac7918
|
|
| MD5 |
897575ae7ed4de59895eb7b0cc6eff4f
|
|
| BLAKE2b-256 |
a6f34ea27854dec1884323828f470cac1d9b968a17e30d32407ec46204439bc5
|