Class X509CertBuilder


  • public class X509CertBuilder
    extends Object
    Helper class to create self-signed X509v3 certificates from key pairs.
    • Method Detail

      • withIssuer

        public X509CertBuilder withIssuer​(String issuer)
        Sets the certificate's issuer
        Parameters:
        issuer - DistinguishedName as defined in RFC 4514, e.g. CN=Issuer
        Returns:
        this
        See Also:
        RFC 4514, Examples
      • withSubject

        public X509CertBuilder withSubject​(String subject)
        Sets the certificate's subject
        Parameters:
        subject - DistinguishedName as defined in RFC 4514, e.g. CN=Subject
        Returns:
        this
        See Also:
        RFC 4514, Examples
      • withNotBefore

        public X509CertBuilder withNotBefore​(Instant notBefore)
        Sets the certificate's begin of validity period
        Parameters:
        notBefore - date before which the certificate is not valid.
        Returns:
        this
      • withNotAfter

        public X509CertBuilder withNotAfter​(Instant notAfter)
        Sets the certificate's end of validity period
        Parameters:
        notAfter - date after which the certificate is not valid.
        Returns:
        this