What is @aws-crypto/caching-materials-manager-node?
@aws-crypto/caching-materials-manager-node is a package provided by AWS that allows for the caching of cryptographic materials in Node.js applications. This can help improve performance by reducing the number of calls to the AWS Key Management Service (KMS) for cryptographic operations.
What are @aws-crypto/caching-materials-manager-node's main functionalities?
Caching Cryptographic Materials
This feature allows you to create a caching materials manager that caches cryptographic materials for a specified duration, number of bytes, or number of messages. This reduces the number of calls to AWS KMS, improving performance.
const { NodeCachingMaterialsManager } = require('@aws-crypto/caching-materials-manager-node');
const { KmsKeyringNode } = require('@aws-crypto/kms-keyring-node');
const keyring = new KmsKeyringNode({
generatorKeyId: 'arn:aws:kms:us-west-2:123456789012:key/abcd1234-abcd-1234-abcd-1234abcd1234',
keyIds: ['arn:aws:kms:us-west-2:123456789012:key/abcd1234-abcd-1234-abcd-1234abcd1234']
});
const cachingCMM = new NodeCachingMaterialsManager({
backingMaterials: keyring,
maxAge: 300000, // 5 minutes
maxBytesEncrypted: 1000000, // 1MB
maxMessagesEncrypted: 1000
});
console.log('Caching Materials Manager created:', cachingCMM);
Other packages similar to @aws-crypto/caching-materials-manager-node
node-cache
node-cache is a simple and fast Node.js internal caching module. It provides a simple API for caching key-value pairs in memory. While it does not specifically handle cryptographic materials, it can be used for general caching purposes in a Node.js application.
memory-cache
memory-cache is another in-memory caching module for Node.js. It provides a simple API for setting, getting, and deleting cached items. Like node-cache, it is not specifically designed for cryptographic materials but can be used for general caching needs.
lru-cache
lru-cache is a least-recently-used (LRU) cache implementation for Node.js. It is useful for caching items with a limited size and automatically evicts the least recently used items when the cache reaches its limit. It is not specifically designed for cryptographic materials but can be used for general caching purposes.
aws-encryption-sdk-javascript
The AWS Encryption SDK for JavaScript is a client-side encryption library
designed to make it easy for everyone to encrypt
and decrypt data using industry standards and best practices.
It uses a data format compatible with the AWS Encryption SDKs in other languages.
For more information on the AWS Encryption SDKs in all languages,
see the Developer Guide.
This package should only be used as part of the AWS Encryption SDK for Javascript.
For more information about the packages in this project
and how they can be used together,
see the main node package readme
Installing
npm install @aws-crypto/caching-materials-manager-node
Testing
npm test
License
This SDK is distributed under the
Apache License, Version 2.0,
see LICENSE.txt and NOTICE.txt for more information.