certificate.exportChallenge(spkac[, encoding])
spkac<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding<string>spkac字符串的编码。- 返回: <Buffer>
spkac数据结构的挑战组件,包括公钥和挑战。
const { Certificate } = await import('node:crypto');
const cert = Certificate();
const spkac = getSpkacSomehow();
const challenge = cert.exportChallenge(spkac);
console.log(challenge.toString('utf8'));
// 打印: the challenge as a UTF8 stringconst { Certificate } = require('node:crypto');
const cert = Certificate();
const spkac = getSpkacSomehow();
const challenge = cert.exportChallenge(spkac);
console.log(challenge.toString('utf8'));
// 打印: the challenge as a UTF8 stringspkac<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView>encoding<string> The encoding of thespkacstring.- Returns: <Buffer> The challenge component of the
spkacdata structure, which includes a public key and a challenge.
const { Certificate } = await import('node:crypto');
const cert = Certificate();
const spkac = getSpkacSomehow();
const challenge = cert.exportChallenge(spkac);
console.log(challenge.toString('utf8'));
// Prints: the challenge as a UTF8 stringconst { Certificate } = require('node:crypto');
const cert = Certificate();
const spkac = getSpkacSomehow();
const challenge = cert.exportChallenge(spkac);
console.log(challenge.toString('utf8'));
// Prints: the challenge as a UTF8 string