exportPublicKey
const { Certificate } = await import('node:crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// Prints: the public key as <Buffer ...>
Content copied to clipboard
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.