forge
forge copied to clipboard
Get private key from forge.pkcs12.Pkcs12Pfx
I am creating a certificate like so, I am not sure how to get the private key from the bag or what the filter should be.
// class propoerty
private readonly certificate: forge.pkcs12.Pkcs12Pfx;
// constructor
forge.pkcs12.pkcs12FromAsn1(privateKey, privateKeyPassword);
// then in another function
// Get the private key for creating the signature
var bags = this.certificate.getBags({});
var rsa = bags.localKeyId[0];