PeculiarVentures / x509

@peculiar/x509 is an easy to use TypeScript/Javascript library based on @peculiar/asn1-schema that makes generating X.509 Certificates and Certificate Requests as well as validating certificate chains easy
https://peculiarventures.github.io/x509/
MIT License
78 stars 10 forks source link

Incorporate extended key usage OIDs #37

Closed CMCDragonkai closed 1 year ago

CMCDragonkai commented 1 year ago

Since KeyUsagesExtension has all the flags already built in, why not add in the basic OIDs for extended key usage?

  const serverAuth = '1.3.6.1.5.5.7.3.1';
  const clientAuth = '1.3.6.1.5.5.7.3.2';
  const codeSigning = '1.3.6.1.5.5.7.3.3';
  const emailProtection = '1.3.6.1.5.5.7.3.4';
  const timeStamping = '1.3.6.1.5.5.7.3.8';
  const ocspSigning = '1.3.6.1.5.5.7.3.9';

      new x509.ExtendedKeyUsageExtension(
        [
          serverAuth,
          clientAuth,
          codeSigning,
          emailProtection,
          timeStamping,
          ocspSigning
        ]
      );