本文整理匯總了TypeScript中node-forge.pki.certificateToPem方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript pki.certificateToPem方法的具體用法?TypeScript pki.certificateToPem怎麽用?TypeScript pki.certificateToPem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類node-forge.pki
的用法示例。
在下文中一共展示了pki.certificateToPem方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: listCertsAsPEMStrings
listCertsAsPEMStrings(): string[] {
const result: string[] = [];
const forgeCerts: any[] = this._forgeCAStore.listAllCertificates();
for (let forgeCert of forgeCerts) {
result.push(forge.pki.certificateToPem(forgeCert));
}
return result;
}
示例2: removeCert
removeCert(cert: ICert | string): ICert | null {
let result: null | ICert;
const removedForgeCert = this._forgeCAStore.removeCertificate(
convertICertOrPEMStringToForgeCert(cert)
);
if (removedForgeCert === null) {
result = null;
} else {
result = new Cert(forge.pki.certificateToPem(removedForgeCert));
}
return result;
}
示例3: function
getCertificate: function(c, hint) {
console.log('Client getting certificate ...');
return forge.pki.certificateToPem(cert);
},
示例4: Error
md = forge.md.sha256.create();
md = md.update('Test');
hex = md.digest().toHex();
signature = keypair.privateKey.sign(md)
if (!keypair.publicKey.verify(md.digest().bytes(), signature)) {
throw Error("rsa signature verification fail");
}
}
{
const emptyStore = forge.pki.createCaStore();
const certificate = cert;
const pem = forge.pki.certificateToPem(certificate);
const caStore = forge.pki.createCaStore();
caStore.addCertificate(certificate);
caStore.removeCertificate(certificate);
caStore.listAllCertificates();
caStore.removeCertificate(certificate);
forge.pki.verifyCertificateChain(caStore, [certificate], (verified, depth, chain) => {
return true;
});
}
{