underlying key buffer
Returns publicKey buffer, it is used for Ed25519/Ed448.
Returns signature for the given data and hash algorithm.
Returns an PKCS#1 ASN.1 object of this RSAPrivateKey
Returns an PKCS#1 DER formatted buffer of this RSAPrivateKey
Return a friendly JSON object for debuging.
Returns an PKCS#1 PEM formatted string of this RSAPrivateKey
Returns an PKCS#8 PEM formatted string of this RSAPrivateKey
Registers an external Signer with object identifier. Built-in verifiers: Ed25519, RSA, others see https://nodejs.org/api/crypto.html#crypto_class_sign
PrivateKey.addSigner(getOID('Ed25519'), function (this: PrivateKey, data: Buffer): Buffer {
const key = this.keyRaw
if (key.length !== 64) {
throw new Error('Invalid signing key.')
}
return Buffer.from(ed25519.detached(data, key))
})
algorithm object identifier
Verifier function
Parse an PrivateKey for X.509 certificate from PKCS#8 PEM formatted buffer or PKCS#1 RSA PEM formatted buffer.
PEM formatted buffer
Generated using TypeDoc
PKCS#1 RSA Private Key