# @rollinginfra/secret-encryption-google-kms

> Encrypt and decrypt secret strings using the Google KMS service.

Latest version **1.0.0** (published 2021-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rollinginfra/secret-encryption-google-kms
pnpm add @rollinginfra/secret-encryption-google-kms
yarn add @rollinginfra/secret-encryption-google-kms
bun add @rollinginfra/secret-encryption-google-kms
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-07-05 |
| First published | 2021-07-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.0.0 |
| Dependencies | 3 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | rollinginfrabot, forbeslindesay |

## Links

- npm: https://www.npmjs.com/package/@rollinginfra/secret-encryption-google-kms
- npm.io page: https://npm.io/package/@rollinginfra/secret-encryption-google-kms

## Dependencies (3)

- [funtypes](https://npm.io/package/funtypes.md) ^3.0.1
- [@google-cloud/kms](https://npm.io/package/@google-cloud/kms.md) ^2.3.0
- [@rollinginfra/types](https://npm.io/package/@rollinginfra/types.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2021-07-05

## README

# Secret Encryption - Google KMS

Encrypt and decrypt secret strings using the Google KMS service.

## Set Up Google KMS

1. Open [Google KMS in the Google Cloud Console](https://console.cloud.google.com/marketplace/product/google/cloudkms.googleapis.com)
1. Enable the API (if not already enabled) by clicking "Enable API"
1. Go to ["Security" -> "Key Management" in the Google Cloud Console](https://console.cloud.google.com/security/kms/keyrings)
1. Create a key ring, noting down the key ring name and key ring location for later.
1. Create a key in your new key ring, noting down the key name for later. The "Purpose" must be set to "Symmetric encrypt/decrypt". All other settings can have any value.
1. (Optional) Use "+ Add Member" on the permissions tab to give the "Cloud KMS CryptoKey Encrypter/Decrypter" role to anyone account that needs to use this secret store.

## Set up your local environment

You can set up your local environment by running `gcloud init` and following the prompts to authenticate.

```ts
import SecretEncryptionGoogleKms from '@rollinginfra/secret-encryption-google-kms';

const encryption = new SecretEncryptionGoogleKms({
  googleProjectID: `YOUR_GOOGLE_PROJECT_NAME`,
  keyRingName: `YOUR_KEY_RING_NAME`,
  keyName: `YOUR_KEY_NAME`,
  location: `YOUR_KEY_RING_LOCATION`,
});
```

---
_Source: https://npm.io/package/@rollinginfra/secret-encryption-google-kms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
