Python Client for Google Cloud KMS
Project description
This is a shared codebase for gcloud-aio-kms and gcloud-rest-kms
Installation
$ pip install --upgrade gcloud-{aio,rest}-kms
Usage
We’re still working on more complete documentation, but roughly you can do:
from gcloud.aio.kms import KMS
from gcloud.aio.kms import decode
from gcloud.aio.kms import encode
kms = KMS('my-kms-project', 'my-keyring', 'my-key-name')
# encrypt
plaintext = 'the-best-animal-is-the-aardvark'
ciphertext = await kms.encrypt(encode(plaintext))
# decrypt
assert decode(await kms.decrypt(ciphertext)) == plaintext
# close the HTTP session
# Note that other options include:
# * providing your own session: `KMS(.., session=session)`
# * using a context manager: `async with KMS(..) as kms:`
await kms.close()
Contributing
Please see our contributing guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gcloud-aio-kms-3.2.0.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for gcloud_aio_kms-3.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c945c0522b552171787e69b4693ece1940eda4c7749eaec6254c9e73e57e9d1 |
|
MD5 | 0d4ee39f8052b1e9c20f888144598d0f |
|
BLAKE2b-256 | 33964a41d94cb7bde14d857b7dd28f3465f38148d30d3b40099afac3b1fb7fb0 |