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
86 stars 14 forks source link

How to define new OID #58

Closed jonsmirl closed 1 year ago

jonsmirl commented 1 year ago

How do I define this OID: MatterRCACId = 1.3.6.1.4.1.37244.1.4

So that I can use it in the name field like this: name: "MatterRCACId = CACACACA00000001",

I see asn1X509.RelativeDistinguishedName() in the test case, but how do I get it into the name field?

image

jonsmirl commented 1 year ago

Finally figured it out....

      name: new x509.Name(new asn1X509.Name([
        new asn1X509.RelativeDistinguishedName([new asn1X509.AttributeTypeAndValue({ type: "1.3.6.1.4.1.37244.1.4", value: new asn1X509.AttributeValue({ printableString: "CACACACA00000001" }) })]),
      ])),