underlying key buffer
Returns the digest of the PublicKey with given hash algorithm.
certificate.publicKey.getFingerprint('sha1', 'PublicKey') // => Buffer
hash algorithm, such as 'sha256', 'sha1'
'PublicKey' or 'PublicKeyInfo'
Returns an ASN.1 object of this PublicKey
Returns an DER formatted buffer of this PublicKey
Return a friendly JSON object for debuging.
Returns an PEM formatted string of this PublicKey
Returns true if the provided data and the given signature matched.
certificate.publicKey.verify(data, signature, 'sha256') // => true or false
data to verify
signature that signed by private key
hash algorithm, such as 'sha256', 'sha1'
Registers an external Verifier with object identifier. Built-in verifiers: Ed25519, RSA, others see https://nodejs.org/api/crypto.html#crypto_class_verify
PublicKey.addVerifier(getOID('Ed25519'), function (this: PublicKey, data: Buffer, signature: Buffer): boolean {
return ed25519.detached.verify(data, signature, this.keyRaw)
})
algorithm object identifier
Verifier function
Parse an PublicKey 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 Public Key