Skip to content

Latest commit

 

History

History
152 lines (114 loc) · 5.21 KB

openssl.md

File metadata and controls

152 lines (114 loc) · 5.21 KB

Functions

createPrivateKey([size])Promise.<buffer>

Generate a private RSA key

createPublicKey(key)Promise.<buffer>

Generate a public RSA key

getModulus(key)Promise.<buffer>

Get modulus

getPublicExponent(key)Promise.<buffer>

Get public exponent

pem2der(key)Promise.<buffer>

Convert PEM to DER encoding

der2pem(action, key, [pubIn])Promise.<buffer>

Convert DER to PEM encoding

readCsrDomains(csr)Promise.<object>

Read domains from a Certificate Signing Request

readCertificateInfo(cert)Promise.<object>

Read information from a certificate

createCsr(data, [key])Promise.<Array.<buffer>>

Create a Certificate Signing Request

createPrivateKey([size]) ⇒ Promise.<buffer>

Generate a private RSA key

Kind: global function
Returns: Promise.<buffer> - Private RSA key

Param Type Default Description
[size] number 2048 Size of the key, default: 2048

createPublicKey(key) ⇒ Promise.<buffer>

Generate a public RSA key

Kind: global function
Returns: Promise.<buffer> - Public RSA key

Param Type Description
key buffer | string PEM encoded private key

getModulus(key) ⇒ Promise.<buffer>

Get modulus

Kind: global function
Returns: Promise.<buffer> - Modulus

Param Type Description
key buffer | string Private key, certificate or CSR

getPublicExponent(key) ⇒ Promise.<buffer>

Get public exponent

Kind: global function
Returns: Promise.<buffer> - Exponent

Param Type Description
key buffer | string Private key, certificate or CSR

pem2der(key) ⇒ Promise.<buffer>

Convert PEM to DER encoding

Kind: global function
Returns: Promise.<buffer> - DER

Param Type Description
key buffer | string PEM encoded private key, certificate or CSR

der2pem(action, key, [pubIn]) ⇒ Promise.<buffer>

Convert DER to PEM encoding

Kind: global function
Returns: Promise.<buffer> - PEM

Param Type Description
action string Output action (x509, rsa, req)
key buffer | string DER encoded private key, certificate or CSR
[pubIn] boolean Result should be a public key, default: false

readCsrDomains(csr) ⇒ Promise.<object>

Read domains from a Certificate Signing Request

Kind: global function
Returns: Promise.<object> - {commonName, altNames}

Param Type Description
csr buffer | string PEM encoded Certificate Signing Request

readCertificateInfo(cert) ⇒ Promise.<object>

Read information from a certificate

Kind: global function
Returns: Promise.<object> - Certificate info

Param Type Description
cert buffer | string PEM encoded certificate

createCsr(data, [key]) ⇒ Promise.<Array.<buffer>>

Create a Certificate Signing Request

Kind: global function
Returns: Promise.<Array.<buffer>> - [privateKey, certificateSigningRequest]

Param Type Description
data object
[data.keySize] number Size of newly created private key, default: 2048
[data.commonName] string default: localhost
[data.altNames] array default: []
[data.country] string
[data.state] string
[data.locality] string
[data.organization] string
[data.organizationUnit] string
[data.emailAddress] string
[key] buffer | string CSR private key