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.6.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.6.tar.gz.
File metadata
- Download URL: ash_kms-0.1.6.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.11.15 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd3f24d12c4123ac57ccb825eb42bb6fa628b422491c56a6ae1394a0dc2161bd
|
|
| MD5 |
715c6c9311c910902f2584c3cac09e16
|
|
| BLAKE2b-256 |
493bb8c7bba52c7a605d6bf5fe10dad2006de13ace62f243bffba6d87770c159
|
File details
Details for the file ash_kms-0.1.6-py3-none-any.whl.
File metadata
- Download URL: ash_kms-0.1.6-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.15 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a027211aa1c8e68dcff1d9247adffaa49f977f546e15de4b213683b2759c3ab3
|
|
| MD5 |
07753563c7fa9383dc66acbe69344cc9
|
|
| BLAKE2b-256 |
ecfbcb6922882a9ee48c5d7e10305aa7d790d0ed487751bcacccc4575c6ba148
|