Skip to content

Instantly share code, notes, and snippets.

@raytung
raytung / spike.js
Created October 13, 2016 09:41
AWS KMS NodeJS
/*
* AWS Sdk KMS spike: (assuming node v6.6+)
* 1 - Create master key at KMS
* 2 - Copy alias or ARN
* 3 - run this i.e.
* $ node spike.js KEY_ALIAS YOUR_PLAINTEXT_TO_ENCRYPT
*/
const AWS = require('aws-sdk');
// aws-sdk is not reading my region info so i'll have to set it here
@raytung
raytung / spike.js
Last active January 4, 2023 09:31
AWS KMS NodeJS
/*
* AWS Sdk KMS spike: (assuming node v6.6+)
* 1 - Create master key at KMS
* 2 - Copy alias or ARN
* 3 - run this i.e.
* $ node spike.js KEY_ALIAS YOUR_PLAINTEXT_TO_ENCRYPT
*/
const AWS = require('aws-sdk');
// aws-sdk is not reading my region info so i'll have to set it here