Interface CertificationRequestBuilder


public interface CertificationRequestBuilder
A fluent builder for a signed PKCS#10 certification request.

Provided so that ZeroEcho tools and tests can generate CSRs natively rather than shelling out to an external tool. The request is signed by a caller supplied ContentSigner, keeping the private key outside the builder.

Instances are single-use and not thread-safe.

  • Method Details

    • subject

      Sets the requested subject distinguished name (required).
      Parameters:
      subject - the subject DN
      Returns:
      this builder
    • publicKey

      CertificationRequestBuilder publicKey(PublicKey publicKey)
      Sets the subject public key (required).
      Parameters:
      publicKey - the subject public key
      Returns:
      this builder
    • subjectAlternativeNames

      CertificationRequestBuilder subjectAlternativeNames(List<GeneralName> names, boolean critical)
      Requests the given subject alternative names via the extension-request attribute.
      Parameters:
      names - the general names
      critical - whether the SAN extension is critical
      Returns:
      this builder
    • requestExtension

      Requests an arbitrary extension via the extension-request attribute.
      Parameters:
      extension - the extension to request
      Returns:
      this builder
    • addAttribute

      CertificationRequestBuilder addAttribute(CsrAttribute attribute)
      Adds an arbitrary PKCS#10 attribute.
      Parameters:
      attribute - the attribute to add
      Returns:
      this builder
    • build

      Signs the assembled certificationRequestInfo and returns the request.
      Parameters:
      signer - the content signer supplying the signature and algorithm
      Returns:
      the signed certification request