Class SctVerifier
java.lang.Object
zeroecho.pki.server.ct.SctVerifier
Verifies Signed Certificate Timestamps collected from CT logs before they may be
embedded in a final certificate.
Verification enforces two invariants per RFC 9162 §4.9 and the operator policy:
- Timestamp freshness: SCTs with a timestamp more than 10 minutes in the future are rejected. A future timestamp indicates a misbehaving or malicious log.
- Signature validity: The SCT's
DigitallySignedstructure must verify against the corresponding log's public key using the pre-certificate as input. Any SCT whose cryptographic signature is invalid is discarded.
SCTs from logs not present in the supplied logPublicKeys map are silently
discarded (the log is not trusted by the operator for this authority).
After filtering, the verifyAll(List, Map, byte[], int) method enforces a minimum SCT count. If
fewer than minScts SCTs survive verification the issuance is aborted by throwing
CtSubmissionException.
Thread safety
This class is stateless and thread-safe.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum allowed clock skew between a CT log and the local clock. -
Method Summary
Modifier and TypeMethodDescriptionstatic List<SignedCertificateTimestamp> verifyAll(List<SignedCertificateTimestamp> scts, Map<String, PublicKey> logPublicKeys, byte[] preCertDer, int minScts) Verifies all collected SCTs and returns the subset that are cryptographically valid, enforcing the minimum count required for issuance.
-
Field Details
-
MAX_FUTURE_DRIFT_MINUTES
public static final int MAX_FUTURE_DRIFT_MINUTESMaximum allowed clock skew between a CT log and the local clock.- See Also:
-
-
Method Details
-
verifyAll
public static List<SignedCertificateTimestamp> verifyAll(List<SignedCertificateTimestamp> scts, Map<String, PublicKey> logPublicKeys, byte[] preCertDer, int minScts) throws CtSubmissionException Verifies all collected SCTs and returns the subset that are cryptographically valid, enforcing the minimum count required for issuance.Steps performed for each SCT:
- Reject if the SCT's log ID is not in
logPublicKeys. - Reject if the SCT's timestamp is more than 10 minutes in the future.
- Reject if
Pkix.verifySct(SignedCertificateTimestamp, PublicKey, byte[])returnsfalsefor the corresponding log public key and pre-certificate.
If the number of surviving SCTs is less than
minScts, this method throwsCtSubmissionException. Otherwise the verified SCTs are returned.- Parameters:
scts- SCTs collected byCtLogSubmitter.submitAll(byte[], List, List, Instant); must not benulllogPublicKeys- map from hex log ID to the corresponding CT log's public key; must not benullpreCertDer- DER-encoded pre-certificate that was submitted; must not benullminScts- minimum number of valid SCTs required for issuance (typically ≥ 2)- Returns:
- immutable list of verified SCTs; never fewer than
minSctselements - Throws:
CtSubmissionException- if fewer thanminSctsSCTs survive verificationNullPointerException- if any argument isnull- Since:
- 1.0
- Reject if the SCT's log ID is not in
-