PeculiarVentures / PKI.js

PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.
http://pkijs.org
Other
1.25k stars 204 forks source link

Example given from pkijs.org does not work with typescript #371

Closed dninet closed 1 year ago

dninet commented 1 year ago

Hi,

I'm trying to parse a CRL file and I've copy&pasted this example from stackoverflow. This example works.

I'm not transitioning the project from javascript to typescript and now I'm getting the following error:

<project_root>/node_modules/pkijs/build/index.js:408
        this.valueBeforeDecode = asn1.result.RDN.valueBeforeDecodeView.slice().buffer;
                                                                       ^
TypeError: Cannot read properties of undefined (reading 'slice')

After trying out the example CRL from pkijs.org, to make sure that it wasn't my own CRL, I got the same result.

microshine commented 1 year ago

Looks like you are using old version of asn1js. valueBeforeDecodeView was implemented in asn1js@3.0.0. Please update your version and try again.

image