exportPublicKey

fun exportPublicKey(spkac: BinaryLike, encoding: String = definedExternally): Buffer(source)
const { Certificate } = await import('node:crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// Prints: the public key as <Buffer ...>

Since

v9.0.0

Return

The public key component of the spkac data structure, which includes a public key and a challenge.

Parameters

encoding

The encoding of the spkac string.