Skip to main content

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.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ash_kms-0.1.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file ash_kms-0.1.1.tar.gz.

File metadata

  • Download URL: ash_kms-0.1.1.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/6.11.0-1018-azure

File hashes

Hashes for ash_kms-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a3919561da7aa711529f1f7dc8ab996f7bff830ef6b69fc7b33e71b4c5ae161e
MD5 6807ac2ad42fab93f047224fc1b83c5c
BLAKE2b-256 c22c1cb5f1ff6cb1280b82e86eb9e7f1c510e42ddd2e76f1e94a7ccd16efb23c

See more details on using hashes here.

File details

Details for the file ash_kms-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ash_kms-0.1.1-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/6.11.0-1018-azure

File hashes

Hashes for ash_kms-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f8104bb3353e0c5247d92c1fbdd616d6d38a12e073faf35a4f5acdd2a201ba7
MD5 6d75ee2e004a9635b76657ce245b18c9
BLAKE2b-256 7ddfcbe1f70eac54e9ca9547dce45bd2c2938e965f6df6448a3153b421886b3f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page