convert

pem convert module

Source:

Methods

(static) DER2PEM(pathIN, pathOUT, typeopt, callback)

Source:

conversion from DER to PEM format

Parameters:
Name Type Attributes Description
pathIN String

path of the DER encoded certificate file

pathOUT String

path of the PEM encoded certificate file to generate

type String <optional>

type of file, use 'rsa' for key file, 'x509' otherwise or leave this parameter out

callback function

callback method called with error, boolean result

(static) P7B2PEM(pathIN, pathOUT, callback)

Source:

conversion from P7B to PEM format

Parameters:
Name Type Description
pathIN String

path of the P7B encoded certificate file

pathOUT String

path of the PEM encoded certificate file to generate

callback function

callback method called with error, boolean result

(static) P7B2PFX(pathBundleIN, pathOUT, password, callback)

Source:

conversion from P7B to PFX/PKCS#12

Parameters:
Name Type Description
pathBundleIN Object

paths of the PEM encoded certificate files ({cert: '...', key: '...', ca: '...' or ['...', ...]})

pathOUT String

path of the PFX certificate file to generate

password String

password to be set for the PFX file and to be used to access the key file

callback function

callback method called with error, boolean result

(static) PEM2DER(pathIN, pathOUT, typeopt, callback)

Source:

conversion from PEM to DER format
if private key is included in PEM encoded file, it won't be included in DER file
use this method with type 'rsa' to export private key in that case

Parameters:
Name Type Attributes Description
pathIN String

path of the PEM encoded certificate file

pathOUT String

path of the DER encoded certificate file to generate

type String <optional>

type of file, use 'rsa' for key file, 'x509' otherwise or leave this parameter out

callback function

callback method called with error, boolean result

(static) PEM2P7B(pathBundleIN, pathOUT, callback)

Source:

conversion from PEM to P7B format

Parameters:
Name Type Description
pathBundleIN Object

paths of the PEM encoded certificate files ({cert: '...', ca: '...' or ['...', ...]})

pathOUT String

path of the P7B encoded certificate file to generate

callback function

callback method called with error, boolean result

(static) PEM2PFX(pathBundleIN, pathOUT, password, callback)

Source:

conversion from PEM to PFX

Parameters:
Name Type Description
pathBundleIN Object

paths of the PEM encoded certificate files ({cert: '...', key: '...', ca: '...' or ['...', ...]})

pathOUT String

path of the PFX encoded certificate file to generate

password String

password to set for accessing the PFX file

callback function

callback method called with error, boolean result

(static) PFX2PEM(pathIN, pathOUT, password, callback)

Source:

conversion from PFX to PEM

Parameters:
Name Type Description
pathIN Object

path of the PFX encoded certificate file

pathOUT String

path of the PEM encoded certificate file to generate

password String

password to set for accessing the PFX file

callback function

callback method called with error, boolean result