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.8.tar.gz (2.8 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.8-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ash_kms-0.1.8.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.11.15 Linux/6.17.0-1011-azure

File hashes

Hashes for ash_kms-0.1.8.tar.gz
Algorithm Hash digest
SHA256 04d173514ad6540c39664446166437b8e4a00a0e0056a9650857e852fc925080
MD5 2b4993df8efb62d288d8efb11ebf3edc
BLAKE2b-256 e3a535060cf060251ffc9d29b885b15355a8e6ff44014d8d7df4806fd9d3d603

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ash_kms-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.11.15 Linux/6.17.0-1011-azure

File hashes

Hashes for ash_kms-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ac143a92201dfe092e307706390152b5f5dfd4a9dc9263434a5f4afc1aa3e936
MD5 2345fbeae1a5b63f6e63cc626a1f2ec1
BLAKE2b-256 2789539301e73e8de21a6651efe70601a905a516658183aaeddd5797ecb1be51

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