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
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.15.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.15.tar.gz.
File metadata
- Download URL: ash_kms-0.1.15.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
297d706eeb3f5fc8988ac837e7db3ef1601ef669c7efa9e16213c313f25c4467
|
|
| MD5 |
7d3f6bbdd88f354f241bb522015c5493
|
|
| BLAKE2b-256 |
0eb980942545a38a47a11b840ad52609272d88b409e4489292e9ea3a60fe26eb
|
File details
Details for the file ash_kms-0.1.15-py3-none-any.whl.
File metadata
- Download URL: ash_kms-0.1.15-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
600fec3c3c0d80cbbdd7dbe3518e7b21757912fd0d66101fecf97553ee2e810d
|
|
| MD5 |
8124e6dbac1a16c4a8bbd5320aa8f60b
|
|
| BLAKE2b-256 |
e3b104ba7f6a3ccc8aab5f5cda3da7d16a8035f89cdfd1f827db1f24d2e775f0
|