certificate.verifySpkac(spkac[, encoding])
-
spkac<string> | <ArrayBuffer> | <Buffer> | <TypedArray> | <DataView> -
返回:<boolean> 如果给定的
spkac数据结构有效,则为true,否则为false。¥Returns: <boolean>
trueif the givenspkacdata structure is valid,falseotherwise.
import { Buffer } from 'node:buffer';
const { Certificate } = await import('node:crypto');
const cert = Certificate();
const spkac = getSpkacSomehow();
console.log(cert.verifySpkac(Buffer.from(spkac)));
// Prints: true or falseconst { Buffer } = require('node:buffer');
const { Certificate } = require('node:crypto');
const cert = Certificate();
const spkac = getSpkacSomehow();
console.log(cert.verifySpkac(Buffer.from(spkac)));
// Prints: true or false