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.9.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.9-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ash_kms-0.1.9.tar.gz
  • Upload date:
  • Size: 2.7 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

Hashes for ash_kms-0.1.9.tar.gz
Algorithm Hash digest
SHA256 0e40fa8c4ded487b6f0016a51995fd026af85f38b48fac02c1fb3bee8d661197
MD5 84f7bdeac637f2494259163c8b6cb4dd
BLAKE2b-256 380f7acf2b4cfb2a84577ebf9a806f4cd585ac26c891972e0ffbd71d2baeac39

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ash_kms-0.1.9-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

Hashes for ash_kms-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 82ea33a9ef744068469b3a904333c8c8226aedeb981c611b84b1d3ab2d1c4437
MD5 5a4de94fbee878acb3d38968da63e925
BLAKE2b-256 9f45fdbd5663ab11fba7d0a2066a0ad0d7ad61902a00ed84ecf03f9107dee8b7

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