KMS Decryption
A simple package that takes a path to a file that's been encrypted with KMS and returns the decrypted contents.
Usage
// Install the packagenpm install // Then in a file where you want to use the package
Decrypt.test has an integration test. You need to encrypt the testSecret.txt file with your credentials and put the testSecret.encrypted file in the src folder. Then create a file named `.clientConfig.ts like this:
The location can be specific to what you set when you created your key credentials.
Here's the gcloud SDK command that will encrypt the file once you substitute in your key ring and key.
gcloud kms encrypt --location global --keyring <your-key-ring> --key <your-key> --plaintext-file testSecret.txt --ciphertext-file testSecret.encrypted