openssl-smime
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i openssl-smime

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

13 kB

Total Files

13

Last publish

Collaborators

  • don-vietnam