google云kms的asyncio python客户端
gcloud-aio-kms的Python项目详细描述
安装
$ pip install --upgrade gcloud-aio-kms
用法
我们仍在开发更完整的文档,但大致可以做到:
fromgcloud.aio.kmsimportKMSfromgcloud.aio.kmsimportdecodefromgcloud.aio.kmsimportencodekms=KMS('my-cred-project','/path/to/creds.json','my-kms-project','my-keyring','my-key-name')# encryptplaintext='the-best-animal-is-the-aardvark'ciphertext=awaitkms.encrypt(encode(plaintext))# decryptassert(awaitkms.decrypt(encode(ciphertext)))==plaintext
贡献
请看我们的contributing guide。