Closed bmagnette closed 3 years ago
I finally found my mistake, I was wrongly using config parameters. The right way to do it ->
const cert = await pem.createCertificate({ clientKey: clientPrivateKey, serviceKey: servicePrivateKey, selfSigned: true, config: [ '[req]', 'req_extensions = v3_req', 'distinguished_name = req_distinguished_name', '[req_distinguished_name]', 'commonName = Common Name', 'commonName_max = 64', '[v3_req]', 'basicConstraints = critical,CA:TRUE',
keyUsage = ${keyUsage}].join('\n'), csr, days: 1095 });
Hi everyone,
Trying to use library pem to generate a certificate with v3_req extension but I'm always getting an error. API documentation says that If I specify config then the v3_req section will be used. But right now, I'm getting this error with this code :
const cert = await pem.createCertificate({ clientKey: clientPrivateKey, serviceKey: servicePrivateKey, selfSigned: true, extFile:
${_dirname}/ext${keyName}.txt, config: {}, csr, days: 1095 });
`[req] req_extensions = v3_req distinguished_name = req_distinguished_name
[req_distinguished_name] commonName = Common Name commonName_max = 64
[v3_req] basicConstraints = critical,CA:TRUE keyUsage = nonRepudiation, digitalSignature, keyEncipherment`
Any idea ?
Regards