digitalbazaar / forge

A native implementation of TLS in Javascript and tools to write crypto-based and network-heavy webapps
https://digitalbazaar.com/
Other
5.01k stars 767 forks source link

Can't create a CSR with extKeyUsage extension #1074

Closed GennadyDagman closed 3 months ago

GennadyDagman commented 3 months ago

While trying to create a CSR I add extKeyUsage extension using setAttributes function like this:

request.setAttributes([ { name: 'challengePassword', value: challengePassword }, { type: '1.2.840.113549.1.9.14', extensions: [ { name: 'extKeyUsage', clientAuth: true }]}]);

CSR is created but looks like it's improperly encoded.

Please advice what I am doing wrong.

GennadyDagman commented 3 months ago

It was my fault - both keyUsage and extKeyUsage have to be present. Everything works fine.