Closed maliksajidhussain closed 2 years ago
Please try to use the latest version of PKIjs. It uses TS implementation and includes type definitions. It should help you to fix some errors during development.
Here is TS implementation of your example with the latest PKIjs version
As you can see, it prints the OCSP request
OCSPRequest {
tbsRequest: TBSRequest {
tbsView: Uint8Array(0) [],
requestList: [ [Request] ],
requestExtensions: [ [Extension] ]
}
}
Thanks for the quick response. I am using simple JavaScript and created bundle js file and make some customization to export function and class of PKI js. Is there any bug in the older version of PKI JS?
There are many bugs in older PKIjs.
There are many bugs in older PKIjs.
@rmhrisk Could you, please, point me any of the "many bugs in older PKIjs"? For the years since I made PKIjs (about 7-8 years) I can remember only two real bugs both related to moving from ES3 to ES6. Maybe your "TypeScript moving team" found others?
Now you can use PKIjs without bundle file
<script type="module">
import * as asn1js from "https://unpkg.com/asn1js@^3?module";
import * as pkijs from "https://unpkg.com/pkijs@^3?module";
// your code here
</script>
Thanks @microshine for the help. My use case was to build OCSP request using offline pki javascript file. We cannot refer any online JS file. I am able to create the request. The issue was some of the classes missing in pki bundle.js.
I am creating an ocsp requesting using a base64 certificate. When I try to print this request I get this error "TypeError: element.toSchema is not a function".
I am using the following sample code. Any thing wrong in the request creation? ocsp.zip