underlying key buffer
Returns publicKey buffer, it is used for Ed25519/Ed448.
Returns signature for the given data and hash algorithm.
Returns an ASN.1 object of this PrivateKey
Returns an DER formatted buffer of this PrivateKey
Return a friendly JSON object for debuging.
Returns an PEM formatted string of this PrivateKey
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#8 Private Key