forge icon indicating copy to clipboard operation
forge copied to clipboard

Get private key from forge.pkcs12.Pkcs12Pfx

Open pmonty opened this issue 3 years ago • 0 comments

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];

pmonty avatar May 03 '22 03:05 pmonty