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
Release history Release notifications | RSS feed
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.0.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file ash_kms-0.1.0.tar.gz
.
File metadata
- Download URL: ash_kms-0.1.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31288ab5405c0a71ba389b31376beaa60e8b3bccc2ce2d38d39132ed56f1b3f1 |
|
MD5 | f3820aab9d93eb8f6a24e69621241ed1 |
|
BLAKE2b-256 | dd2bd17baced7dc67c21a301c9be2539643f6bcb88e8ce004669f1feada37505 |
File details
Details for the file ash_kms-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ash_kms-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ec7d219ade04dbb154f76d395456cdf3a44e846656018bfc5f535192d24a25 |
|
MD5 | f1ca28b34ce7a22efc73dbaef55d9dce |
|
BLAKE2b-256 | 04e82de22235cdc79dbf76f824e241ac1d650b90ae96f5f3a3770304388e9582 |