Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KMS]: Is it working with cryptographic keys on GCP KMS? #76

Open
Ahmadre opened this issue Aug 22, 2023 · 5 comments
Open

[KMS]: Is it working with cryptographic keys on GCP KMS? #76

Ahmadre opened this issue Aug 22, 2023 · 5 comments

Comments

@Ahmadre
Copy link

Ahmadre commented Aug 22, 2023

I have my own Key on Google Cloud Platform in KMS with Key Rotation and all of that.

Can I use it here as my encryption key?

see: https://www.npmjs.com/package/@google-cloud/kms

@franky47
Copy link
Member

I'm not familiar with their API, but if it lets you manage 32 byte keys (for AES 256) and get access to the raw key material, you should be able to format it in a way the underlying encryption library understands:

k1.aesgcm256.{base64url encoded key material}

@Ahmadre
Copy link
Author

Ahmadre commented Aug 25, 2023

I'm not familiar with their API, but if it lets you manage 32 byte keys (for AES 256) and get access to the raw key material, you should be able to format it in a way the underlying encryption library understands:

k1.aesgcm256.{base64url encoded key material}

Thank you for your quick answer :).

Actually that's not possible to access the raw key material, because that's the security and controlling of encryption/decryption behind KMS providers. Keys are living encrypted in Google Cloud Server and can never be exposed in any way. Rather you can call encrypt/decrypt methods which will be executed in the GCP KMS.

I forked your repository and added a WIP support for GCP KMS: Ahmadre@b03d2c5

@franky47
Copy link
Member

franky47 commented Aug 25, 2023

We could envision a way to configure the cryptographic layer to use such external providers, in addition to doing it locally by default.

A sort of plugin architecture would be best suited for this, so other KMS can be added in the future (eg: Hashicorp Vault, AWS, Azure etc). Even better would be to follow an existing common interface, if such a thing exists.

@masterbater
Copy link

Please add AWS KMS

@franky47
Copy link
Member

franky47 commented Sep 8, 2023

Would you like to open a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants