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.14.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.14.tar.gz.
File metadata
- Download URL: ash_kms-0.1.14.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 |
c7811a0fba4906a737d4db3f98db87275dc38514635c89dbf86a1fb31bcf7245
|
|
| MD5 |
ff83a2dc445602c7bcf061d50dd689f7
|
|
| BLAKE2b-256 |
6f660712c6d17d0de9a60d73fb00ccbd3063b2a866b1f0ad57585572da6febcc
|
File details
Details for the file ash_kms-0.1.14-py3-none-any.whl.
File metadata
- Download URL: ash_kms-0.1.14-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 |
b9e046ca13ed5276fbf70cf79e0b61c9842c0acbdadb4797c8a385388156562a
|
|
| MD5 |
b160f84543e7f75c6e62b05ee4c67cf7
|
|
| BLAKE2b-256 |
57f621301fd24ecd11028b2d0249c19f3e522c39872ad7b74919c9823cc3deed
|