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

Unable to inject IP address into CSR #286

Closed sureshreddygovindu closed 3 years ago

sureshreddygovindu commented 3 years ago

Thank for your help!!! I'm using PKI.js to generate CSR, I able to generate CSR successfully but unable to inject SAN IPV4 address into it. I able to inject SAN domainname, URI, email but not IP address.

below are the code snippet I'm using to inject IP.

keyPurposes.push(new GeneralName({
        type: 7, 
        value: "10.10.43.444"
    })

Exception

vendor.js:73463 ERROR TypeError: Cannot set property 'tagClass' of undefined
    at GeneralName.toSchema (vendor.js:330997)
YuryStrozhevsky commented 3 years ago

@sureshreddygovindu Seems you did not check this example and especially this line of code.

sureshreddygovindu commented 3 years ago

Thanks!