Certificate.exportPublicKey(spkac[, encoding])
spkac
<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding
<string>spkac
字符串的编码。- 返回: <Buffer>
spkac
数据结构的公钥组件,包括公钥和挑战。
const { Certificate } = await import('node:crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// 打印: the public key as <Buffer ...>
const { Certificate } = require('node:crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// 打印: the public key as <Buffer ...>
spkac
<string> | <ArrayBuffer> | <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 } = await import('node:crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// Prints: the public key as <Buffer ...>
const { Certificate } = require('node:crypto');
const spkac = getSpkacSomehow();
const publicKey = Certificate.exportPublicKey(spkac);
console.log(publicKey);
// Prints: the public key as <Buffer ...>