Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongodb-client-encryption

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-client-encryption

Official client encryption module for the MongoDB Node.js driver

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
decreased by-60.53%
Maintainers
1
Weekly downloads
 
Created
Source

MongoDB Client Encryption

The Node.js wrapper for libmongocrypt

Requirements

Follow the instructions for building libmongocrypt here.

Installation

Now you can install mongodb-client-encryption with the following:

npm install mongodb-client-encryption

Testing

Run the test suite using:

npm test

Documentation

Classes

AutoEncrypter

An internal class to be used by the driver for auto encryption NOTE: Not meant to be instantiated directly, this is for internal use only.

ClientEncryption

The public interface for explicit client side encryption

Typedefs

AutoEncryptionExtraOptions

AutoEncrypter

An internal class to be used by the driver for auto encryption NOTE: Not meant to be instantiated directly, this is for internal use only.

new AutoEncrypter(options)

ParamTypeDescription
optionsobjectOptional settings
options.clientMongoClientThe parent client auto encryption is enabled on
options.keyVaultNamespacestringThe namespace of the key vault, used to store encryption keys
options.schemaMapobject
options.kmsProvidersobject
options.loggerfunction
[options.extraOptions]AutoEncryptionExtraOptionsExtra options related to mongocryptd

Create an AutoEncrypter

autoEncrypter.encrypt(ns, cmd, callback)

ParamTypeDescription
nsstringThe namespace for this encryption context
cmdobjectThe command to encrypt
callbackfunction

Encrypt a command for a given namespace

autoEncrypter.decrypt(buffer, callback)

ParamType
buffer*
callback*

Decrypt a command response

ClientEncryption

The public interface for explicit client side encryption

new ClientEncryption(client, options)

ParamTypeDescription
clientMongoClientThe client used for encryption
optionsobjectOptional settings
options.keyVaultNamespacestringThe namespace of the key vault, used to store encryption keys

Create a new encryption instance

clientEncryption.createDataKey(provider, options, callback)

ParamTypeDescription
providerstringThe KMS provider used for this data key
options*
callbackfunction

Creates a data key used for explicit encryption

clientEncryption.encrypt(value, options, callback)

ParamType
value*
options*
callback*

Explicitly encrypt a provided value

clientEncryption.decrypt(value, callback)

ParamType
value*
callback*

Explicitly decrypt a provided encrypted value

AutoEncryptionExtraOptions

Properties

NameTypeDefaultDescription
[mongocryptdURI]stringoverrides the uri used to connect to mongocryptd
[mongocryptdBypassSpawn]booleanfalseif true, autoEncryption will not spawn a mongocryptd
[mongocryptdSpawnPath]stringthe path to the mongocryptd executable
[mongocryptdSpawnArgs]Array.<string>command line arguments to pass to the mongocryptd executable

FAQs

Package last updated on 12 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc