java.lang.Object
se.swedenconnect.sigval.commons.timestamp.TimeStamp

public class TimeStamp extends Object
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 Details

    • timeStampSigBytes

      protected byte[] timeStampSigBytes
    • timestampedData

      protected byte[] timestampedData
    • sigValid

      protected boolean sigValid
    • certList

      protected List<X509Certificate> certList
    • sigCert

      protected X509Certificate sigCert
    • tstInfo

      protected org.bouncycastle.asn1.tsp.TSTInfo tstInfo
    • tsPolicyVerifier

      protected final TimeStampPolicyVerifier 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

      protected Exception 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 timestamp
      timestampedData - the data that was hashed and timestamped
      tsPolicyVerifier - 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

      protected void init() throws Exception
      Override this method with extended initializations
      Throws:
      Exception - on errors during initialization
    • verifyTsMessageImprint

      protected void verifyTsMessageImprint() throws Exception
      Verifies if the timestamped data matches the timestamp
      Throws:
      Exception - errors parsing timestamp data