Pem

util~ Pem

Utilities for RSA-related DER/PEM encoding.

Constructor

new Pem()

Source:

Methods

(static) modulusFromPrivateKey(privateKey) → {Buffer}

Retrieve a modulus from a PEM-encoded private key.

Parameters:
Name Type Description
privateKey String

PEM-encoded RSA private key.

Source:
Returns:

modulus RSA public modulus.

Type
Buffer

(static) modulusToPem(modulus) → {String}

Convert an RSA modulus to a PEM-encoded RSAPublicKey.

Encodes the public using the RSAPublicKey format given in RFC 3447, appendix C.

This function assumes that the exponent is 65537.

Parameters:
Name Type Description
modulus Buffer

RSA public modulus.

Source:
Returns:

PEM-encoded RSA public key.

Type
String