java.lang.Object
eu.europa.esig.dss.validation.process.vpfswatsp.POEExtraction

public class POEExtraction extends Object
5.6.2.3 POE extraction 5.6.2.3.1 Description This building block derives POEs from a given time-stamp. Assumptions: - The time-stamp validation has returned PASSED. - The cryptographic hash function used in the time-stamp (messageImprint.hashAlgorithm) is considered reliable at current time or, if this is not the case, a PoE for that time-stamp exists for a time when the hash function has still been considered reliable. In the simple case, a time-stamp gives a POE for each data item protected by the time-stamp at the generation date/time of the token. EXAMPLE: A time-stamp on the signature value gives a POE of the signature value at the generation date/time of the time-stamp. A time-stamp can also give an indirect POE when it is computed on the hash value of some data instead of the data itself. A POE for DATA at T1 can be derived from the time-stamp: - If there is a POE for h(DATA) at a date T1,where h is a cryptographic hash function and DATA is some data (e.g. a certificate), - if h is asserted in the cryptographic constraints to be trusted until at least a date T after T1; and - if there is a POE for DATA at a date T after T1.
  • Constructor Details

    • POEExtraction

      public POEExtraction()
      Default constructor initializing an empty map
  • Method Details

    • init

      public void init(DiagnosticData diagnosticData, Date controlTime)
      Instantiates a controlTime POE for all used tokens
      Parameters:
      diagnosticData - DiagnosticData containing all tokens to initialize the POE for
      controlTime - Date defining the time of POE
    • collectAllPOE

      public void collectAllPOE(Collection<TimestampWrapper> timestamps)
      Extracts all POEs from the provided collection of timestamps
      Parameters:
      timestamps - a collection of TimestampWrappers
    • extractPOE

      public void extractPOE(TimestampWrapper timestamp)
      Extracts POE for all covered objects from a single timestamp wrapper
      Parameters:
      timestamp - TimestampWrapper to extract POE from
    • addSignaturePOE

      public void addSignaturePOE(SignatureWrapper signature, POE proofOfExistence)
      Adds a specific POE for a signature wrapper
      Parameters:
      signature - SignatureWrapper
      proofOfExistence - POE
    • isPOEExists

      public boolean isPOEExists(String tokenId, Date controlTime)
      Returns true if there is a POE exists for a given id at (or before) the control time.
      Parameters:
      tokenId - the token id to be find
      controlTime - the control time
      Returns:
      TRUE if the POE exists, FALSE otherwise
    • isPOEExistInRange

      public boolean isPOEExistInRange(String tokenId, Date notBefore, Date notAfter)
      Checks if a POE exists for the token with the given Id within the validity range between notBefore and notAfter inclusively
      Parameters:
      tokenId - String the Id of a token to check POE for
      notBefore - Date the start of the validity range
      notAfter - Date the end of the validity range
      Returns:
      TRUE if a POE exists in the range, FALSE otherwise
    • getLowestPOETime

      public Date getLowestPOETime(String tokenId)
      Returns the lowest POE time for the requested token
      Parameters:
      tokenId - String is of the token to get the lowest POE time for
      Returns:
      Date representing the lowest POE time for the token
    • getLowestPOE

      public POE getLowestPOE(String tokenId)
      Returns the lowest POE for the requested token NOTE: can return NULL if POE is not found (init(controlTime) method must be executed before)
      Parameters:
      tokenId - String id of token to get the lowest POE for
      Returns:
      the lowest POE for the token