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 Summary
Modifier and TypeMethodDescriptionaddAttribute(CsrAttribute attribute) Adds an arbitrary PKCS#10 attribute.build(ContentSigner signer) Signs the assembledcertificationRequestInfoand returns the request.Sets the subject public key (required).requestExtension(CertificateExtension extension) Requests an arbitrary extension via the extension-request attribute.subject(X500Principal subject) Sets the requested subject distinguished name (required).subjectAlternativeNames(List<GeneralName> names, boolean critical) Requests the given subject alternative names via the extension-request attribute.
-
Method Details
-
subject
Sets the requested subject distinguished name (required).- Parameters:
subject- the subject DN- Returns:
- this builder
-
publicKey
Sets the subject public key (required).- Parameters:
publicKey- the subject public key- Returns:
- this builder
-
subjectAlternativeNames
Requests the given subject alternative names via the extension-request attribute.- Parameters:
names- the general namescritical- 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
Adds an arbitrary PKCS#10 attribute.- Parameters:
attribute- the attribute to add- Returns:
- this builder
-
build
Signs the assembledcertificationRequestInfoand returns the request.- Parameters:
signer- the content signer supplying the signature and algorithm- Returns:
- the signed certification request
-