p12 文件,我想从中提取公钥和私钥以及带有 pki.js 的 x509 证书但是我的 .p12 文件有密码,我该如何解码它。例如:
const asn1js = require("asn1js");
const pkijs = require("pkijs");
const Certificate = pkijs.Certificate;
let path = __dirname + "/file.p12";
let file = fs.readFileSync(path);
const asn1 = asn1js.fromBER(file);
//What do I do with the password for the .p12 file?
const certificate = new Certificate({ schema: asn1.result });