vt-middleware / cryptacular

The friendly complement to the BouncyCastle crypto API for Java.
Other
39 stars 7 forks source link

67 - Additional certificate utility methods #68

Closed haripri-vt closed 5 months ago

haripri-vt commented 6 months ago

Adds the following useful methods to CertUtil:

  1. encodeCert - produce the PEM-encoding given an X509Certificate object
  2. subjectDN - produce a string version of the subject of the given X509Certificate object
  3. generateCert - Produce a self-signed X509Certificate object given a key pair and validity period as a Duration and an overloaded method with notBefore and notAfter.
dfish3r commented 6 months ago

I created a PR to generify the encoding implementation: https://github.com/vt-middleware/cryptacular/pull/74 Admittedly, I don't know how this will affect your downstream API usage, but it felt like a cleaner implementation.

serac commented 6 months ago

I believe this is good to go now.