spkac
{string | Buffer | TypedArray | DataView}encoding
{string} The [encoding][] of thespkac
string.- Returns: {Buffer} The public key component of the
spkac
data structure, which includes a public key and a challenge.
const { Certificate } = require('crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// Prints: the public key as <Buffer ...>