Class CtIssuanceInterceptor
For each issuance, beforeSigning(byte[], List, ContentSigner) performs the full RFC 9162 pre-issuance
CT sequence:
- Build a CT pre-certificate by adding the CT poison extension and signing it with
the CA's key (
PreCertificateBuilder). - Submit the pre-certificate in parallel to all configured CT logs and collect SCTs
within the configured timeout (
CtLogSubmitter). - Verify each collected SCT's timestamp freshness and cryptographic signature
against the corresponding log's public key (
SctVerifier). - Embed the verified SCTs into the original
TBSCertificateas the SCT list extension (OID 1.3.6.1.4.1.11129.2.4.2) usingPkix.embedScts(byte[], List). - Return the modified
TBSCertificateDER for final signing.
If fewer than minScts SCTs survive verification the method throws
CtSubmissionException and the issuance is aborted. No serial number is
consumed and no credential is committed to the store.
This interceptor is a no-op when instantiated with an empty log list (useful for
authorities that do not require CT). Use the factory method disabled() to
obtain a disabled instance.
Thread safety
This class is immutable and thread-safe after construction.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCtIssuanceInterceptor(List<CtLogClient> logs, Map<String, PublicKey> logPublicKeys, int minScts, Duration submissionTimeout) Creates a CT issuance interceptor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]beforeSigning(byte[] tbsCertificateDer, List<byte[]> issuerChainDer, ContentSigner signer) Executes the CT pre-issuance pipeline and returns the modifiedTBSCertificateDER with SCTs embedded.static CtIssuanceInterceptordisabled()Returns a disabled interceptor that passestbsCertificateDerthrough unchanged.booleanReturnstrueif this interceptor has at least one CT log configured.intminScts()Returns the minimum number of valid SCTs required for issuance.Returns the maximum time allowed for parallel log submission.
-
Constructor Details
-
CtIssuanceInterceptor
public CtIssuanceInterceptor(List<CtLogClient> logs, Map<String, PublicKey> logPublicKeys, int minScts, Duration submissionTimeout) Creates a CT issuance interceptor.- Parameters:
logs- CT log clients to submit pre-certificates to; must not benull; may be empty (disables CT for this authority)logPublicKeys- map from hex log ID to the log's EC or RSA public key; must not benullminScts- minimum number of valid SCTs required for issuance (typically ≥ 2)submissionTimeout- maximum total time allowed for parallel log submission; must not benulland must be positive- Throws:
NullPointerException- if any argument isnullIllegalArgumentException- ifminSctsis negative orsubmissionTimeoutis not positive- Since:
- 1.0
-
-
Method Details
-
disabled
Returns a disabled interceptor that passestbsCertificateDerthrough unchanged.This sentinel avoids null checks at call sites for authorities without CT configured.
- Returns:
- disabled interceptor instance
- Since:
- 1.0
-
isEnabled
public boolean isEnabled()Returnstrueif this interceptor has at least one CT log configured.- Returns:
trueif CT log submission will be performed- Since:
- 1.0
-
beforeSigning
public byte[] beforeSigning(byte[] tbsCertificateDer, List<byte[]> issuerChainDer, ContentSigner signer) throws CtSubmissionException Executes the CT pre-issuance pipeline and returns the modifiedTBSCertificateDER with SCTs embedded.If this interceptor was constructed with an empty log list (see
disabled()), the inputtbsCertificateDeris returned unchanged.- Parameters:
tbsCertificateDer- DER-encodedTBSCertificatefor the certificate being issued; must not benullissuerChainDer- DER-encoded issuer chain, issuer certificate first; must not benullsigner- content signer for the issuing CA key, used to sign the pre-certificate; must not benull- Returns:
- DER-encoded
TBSCertificatewith the SCT list extension embedded - Throws:
CtSubmissionException- if fewer thanminSctsSCTs survive verificationIllegalArgumentException- if pre-certificate construction or SCT embedding failsNullPointerException- if any argument isnull- Since:
- 1.0
-
minScts
public int minScts()Returns the minimum number of valid SCTs required for issuance.- Returns:
- minimum SCT count
- Since:
- 1.0
-
submissionTimeout
Returns the maximum time allowed for parallel log submission.- Returns:
- submission timeout
- Since:
- 1.0
-