Skip to content

Latest commit

 

History

History
134 lines (100 loc) · 4.34 KB

forge.md

File metadata and controls

134 lines (100 loc) · 4.34 KB

Objects

forge : object

node-forge crypto engine

Functions

createPrivateKey([size])Promise.<buffer>

Generate a private RSA key

createPublicKey(key)Promise.<buffer>

Generate a public RSA key

getModulus(input)Promise.<buffer>

Get modulus

getPublicExponent(input)Promise.<buffer>

Get public exponent

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

forge : object

node-forge crypto engine

Kind: global namespace

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(input) ⇒ Promise.<buffer>

Get modulus

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

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

getPublicExponent(input) ⇒ Promise.<buffer>

Get public exponent

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

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

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
[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