Class TimeStamp
java.lang.Object
se.swedenconnect.sigval.commons.timestamp.TimeStamp
This class parse validates and holds the essential information about a RFC 3161 timestamp. This class implements a
special case of timestamp processing related to PDF/CMS signature validation where we have access to the data that
was timestamped. Verification is performed on the signature on the timestamp as well as that it matches the
timestamped data.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected se.idsec.signservice.security.certificate.CertificateValidationResultprotected List<X509Certificate> protected Exceptionprotected List<se.swedenconnect.sigval.svt.claims.PolicyValidationClaims> protected X509Certificateprotected booleanprotected byte[]protected byte[]protected final TimeStampPolicyVerifierList of policy verifiers determining if the signing certificate is trusted and the time stamp meets all defined policy requirementsprotected org.bouncycastle.asn1.tsp.TSTInfo -
Constructor Summary
ConstructorsConstructorDescriptionTimeStamp(byte[] timeStampSigBytes, byte[] timestampedData, TimeStampPolicyVerifier tsPolicyVerifier) Loads and verifies a timestamp. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if a valid timestamp was loadedprotected voidinit()Override this method with extended initializationsprotected voidVerifies if the timestamped data matches the timestamp
-
Field Details
-
timeStampSigBytes
protected byte[] timeStampSigBytes -
timestampedData
protected byte[] timestampedData -
sigValid
protected boolean sigValid -
certList
-
sigCert
-
tstInfo
protected org.bouncycastle.asn1.tsp.TSTInfo tstInfo -
tsPolicyVerifier
List of policy verifiers determining if the signing certificate is trusted and the time stamp meets all defined policy requirements -
policyValidationClaimsList
protected List<se.swedenconnect.sigval.svt.claims.PolicyValidationClaims> policyValidationClaimsList -
certificateValidationResult
protected se.idsec.signservice.security.certificate.CertificateValidationResult certificateValidationResult -
exception
-
-
Constructor Details
-
TimeStamp
public TimeStamp(byte[] timeStampSigBytes, byte[] timestampedData, TimeStampPolicyVerifier tsPolicyVerifier) throws Exception Loads and verifies a timestamp.- Parameters:
timeStampSigBytes- the CMS signature bytes holding the RFC 3161 timestamptimestampedData- the data that was hashed and timestampedtsPolicyVerifier- a verifier capable of validating the signature on the timestamp- Throws:
Exception- on errors parsing timestamp
-
-
Method Details
-
hasVerifiedTimestamp
public boolean hasVerifiedTimestamp()Test if a valid timestamp was loaded- Returns:
- true if the loaded data contained a valid timestamp
-
init
Override this method with extended initializations- Throws:
Exception- on errors during initialization
-
verifyTsMessageImprint
Verifies if the timestamped data matches the timestamp- Throws:
Exception- errors parsing timestamp data
-