This package provides Key Management related functionalities using either Node Crypto or AWS KMS. It provides the following functionalities:
$ npm install --save @am92/kms
The following environment variables need to be set to work with this package:
##### KMS Config
export KMS_ENABLED=false
export KMS_TYPE=''
export KMS_KEY_SPEC='AES_256'
export KMS_KEY_PAIR_SPEC='RSA_2048'
export KMS_KEY_FORMAT='base64'
export KMS_PLAIN_TEXT_FORMAT='base64'
export KMS_CIPHER_TEXT_FORMAT='base64'
export KMS_MASTER_KEY_HEX='0000000000000000000000000000000000000000000000000000000000000000'
export KMS_MASTER_IV_HEX='00000000000000000000000000000000'
export KMS_AWS_REGION='ap-south-1'
export KMS_AWS_KEY_ID=''
Note:
import { Kms } from '@am92/kms'
const kms = new Kms()
export default kms
If you wish to pass your custom 'config' to Kms Class, then you can build it as follows:
import { Kms } from '@am92/kms'
const config = {
KMS_TYPE: 'NODE'
}
const kms = new Kms(config)
export default kms
Ankit Gandhi |
Mehul Agarwal |