静态方法:Certificate.exportChallenge(spkac[, encoding])
【Static method: Certificate.exportChallenge(spkac[, encoding])】
spkac<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding<string>spkac字符串的 编码。- 返回: <Buffer>
spkac数据结构的挑战组件,其中包含公钥和挑战。
const { Certificate } = await import('node:crypto');
const spkac = getSpkacSomehow();
const challenge = Certificate.exportChallenge(spkac);
console.log(challenge.toString('utf8'));
// Prints: the challenge as a UTF8 stringconst { Certificate } = require('node:crypto');
const spkac = getSpkacSomehow();
const challenge = Certificate.exportChallenge(spkac);
console.log(challenge.toString('utf8'));
// Prints: the challenge as a UTF8 string