JSPM

openssl-smime

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q50476F
  • License MIT

Node.js wrapper for OpenSSL S/MIME utility.

Package Exports

  • openssl-smime

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (openssl-smime) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

openssl-smime

Node.js wrapper for OpenSSL S/MIME utility.

Documentation in Russian

Full documentation on the S / MIME function and its parameters can be found at link.

Requirements

  • The system must have the OpenSSL Toolkit installed.

Installation

npm i openssl-smime

Examples of using

const smime = require( 'openssl-smime' );

( async () => {

  const data = 'some text';

  const pkcs7 = await smime( 'sign', {
    nointern: true,
    nodetach: true,
    nocerts: true,
    nochain: true,
    outform: 'PEM',
    signer: 'path/to/cert/cert.pem',
    inkey: 'path/to/key/key.pem',
  }, data );

  const verified = await smime( 'verify', {
    noverify: true,
    inform: 'PEM',
    nointern: true,
    certfile: 'path/to/cert/cert.pem',
    CAfile: 'path/to/cert/cert.pem'
  }, pkcs7 );

} )();

Arguments

smime( method, options, content )

Argument Type Description
method sting One of the S/MIME function operations: sign / resign / encrypt / decrypt / verify / pk7out
options object An object with parameters for the operation. The full list can be found in the OpenSSL documentation.
content string/Buffer If the options.in parameter is omitted, the content will be passed to the OpenSSL operation for encoding or decoding.