Class OfflineRevocationSource<R extends Revocation>

java.lang.Object
eu.europa.esig.dss.spi.x509.revocation.OfflineRevocationSource<R>
Type Parameters:
R - the revocation class type (CRL/OCSP)
All Implemented Interfaces:
MultipleRevocationSource<R>, RevocationSource<R>, Serializable
Direct Known Subclasses:
OfflineCRLSource, OfflineOCSPSource

public abstract class OfflineRevocationSource<R extends Revocation> extends Object implements RevocationSource<R>, MultipleRevocationSource<R>
Represents a revocation sources for a data obtained from an offline source (e.g. signature)
See Also:
  • Constructor Details

  • Method Details

    • addBinary

      public void addBinary(EncapsulatedRevocationTokenIdentifier<R> binary, RevocationOrigin origin)
      This method adds a token binary with its origin
      Parameters:
      binary - the binary token to be added
      origin - the origin where the token has been found
    • addRevocation

      public void addRevocation(RevocationToken<R> token, RevocationOrigin origin)
      This method adds a revocation token with its origin
      Parameters:
      token - the revocation token to be added
      origin - the origin where the token has been found
    • addRevocation

      public void addRevocation(RevocationToken<R> token, EncapsulatedRevocationTokenIdentifier<R> binary)
      This method adds a RevocationToken from the binary
      Parameters:
      token - the token to be added
      binary - the binary where the token has been extracted
    • addRevocationReference

      public void addRevocationReference(RevocationRef<R> reference, RevocationRefOrigin origin)
      This method adds a revocation reference with its origin
      Parameters:
      reference - the revocation reference to be added
      origin - the origin where the reference has been found
    • getAllRevocationBinaries

      public Set<EncapsulatedRevocationTokenIdentifier<R>> getAllRevocationBinaries()
      Retrieves all found revocation binaries
      Returns:
      a Set of EncapsulatedRevocationTokenIdentifier
    • getAllRevocationBinariesWithOrigins

      public Map<EncapsulatedRevocationTokenIdentifier<R>,Set<RevocationOrigin>> getAllRevocationBinariesWithOrigins()
      Retrieves all found revocation binaries with their origins
      Returns:
      a Map of EncapsulatedRevocationTokenIdentifier with their origins
    • getAllRevocationTokens

      public Set<RevocationToken<R>> getAllRevocationTokens()
      Retrieves a Set of all found RevocationToken
      Returns:
      all RevocationToken
    • getAllRevocationTokensWithOrigins

      public Map<RevocationToken<R>,Set<RevocationOrigin>> getAllRevocationTokensWithOrigins()
      Returns all tokens with their origins
      Returns:
      a map of tokens with the different origins
    • getUniqueRevocationTokensWithOrigins

      public Map<RevocationToken<R>,Set<RevocationOrigin>> getUniqueRevocationTokensWithOrigins()
      Returns a Map of unique RevocationToken based on binary (a same binary can cover several certificates) with their origins
      Returns:
      a map of tokens with the different origins
    • getAllRevocationReferences

      public Set<RevocationRef<R>> getAllRevocationReferences()
      Retrieves a Set of all found RevocationRef
      Returns:
      all RevocationRef
    • getRevocationReferencesWithOrigins

      protected Map<RevocationRef<R>,Set<RevocationRefOrigin>> getRevocationReferencesWithOrigins()
      Returns a map of revocation references with the corresponding origins
      Returns:
      a map between RevocationRefs and a set of RevocationRefOrigins
    • getRevocationToken

      public RevocationToken<R> getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken)
      This method returns the latest issued revocation token from a set of all revocation data found for the given certificateToken. Returns NULL, if no corresponding revocation data found for the certificate.
      Specified by:
      getRevocationToken in interface RevocationSource<R extends Revocation>
      Parameters:
      certificateToken - The CertificateToken for which the request is made
      issuerCertificateToken - The CertificateToken which is the issuer of the certificateToken
      Returns:
      RevocationToken
    • getCMSSignedDataRevocationBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getCMSSignedDataRevocationBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in the CMS SignedData NOTE: Applicable only for CAdES revocation sources
      Returns:
      list of EncapsulatedRevocationTokenIdentifiers
    • getCMSSignedDataRevocationTokens

      public List<RevocationToken<R>> getCMSSignedDataRevocationTokens()
      Retrieves the list of all RevocationTokens present in the CMS SignedData NOTE: Applicable only for CAdES revocation sources
      Returns:
      list of RevocationTokens
    • getRevocationValuesBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getRevocationValuesBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in 'RevocationValues' element
      Returns:
      list of EncapsulatedRevocationTokenIdentifiers
    • getRevocationValuesTokens

      public List<RevocationToken<R>> getRevocationValuesTokens()
      Retrieves the list of all RevocationTokens present in 'RevocationValues' element
      Returns:
      list of RevocationTokens
    • getAttributeRevocationValuesBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getAttributeRevocationValuesBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in 'AttributeRevocationValues' element
      Returns:
      list of EncapsulatedRevocationTokenIdentifiers
    • getAttributeRevocationValuesTokens

      public List<RevocationToken<R>> getAttributeRevocationValuesTokens()
      Retrieves the list of all RevocationTokens present in 'AttributeRevocationValues' element
      Returns:
      list of RevocationTokens
    • getTimestampValidationDataBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getTimestampValidationDataBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in 'TimestampValidationData' element
      Returns:
      list of EncapsulatedRevocationTokenIdentifiers
    • getTimestampValidationDataTokens

      public List<RevocationToken<R>> getTimestampValidationDataTokens()
      Retrieves the list of all RevocationTokens present in 'TimestampValidationData' element
      Returns:
      list of RevocationTokens
    • getDSSDictionaryBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getDSSDictionaryBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in 'DSS' dictionary NOTE: Applicable only for PAdES revocation source
      Returns:
      list of RevocationTokens
    • getDSSDictionaryTokens

      public List<RevocationToken<R>> getDSSDictionaryTokens()
      Retrieves the list of all RevocationTokens present in 'DSS' dictionary NOTE: Applicable only for PAdES revocation source
      Returns:
      list of RevocationTokens
    • getVRIDictionaryBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getVRIDictionaryBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in 'VRI' dictionary NOTE: Applicable only for PAdES revocation source
      Returns:
      list of RevocationTokens
    • getVRIDictionaryTokens

      public List<RevocationToken<R>> getVRIDictionaryTokens()
      Retrieves the list of all RevocationTokens present in 'VRI' dictionary NOTE: Applicable only for PAdES revocation source
      Returns:
      list of RevocationTokens
    • getADBERevocationValuesBinaries

      public List<EncapsulatedRevocationTokenIdentifier<R>> getADBERevocationValuesBinaries()
      Retrieves the list of all EncapsulatedRevocationTokenIdentifiers present in the ADBE signed attribute
      Returns:
      list of EncapsulatedRevocationTokenIdentifiers
    • getADBERevocationValuesTokens

      public List<RevocationToken<R>> getADBERevocationValuesTokens()
      Retrieves the list of all RevocationTokens present in the ADBE signed attribute NOTE: Applicable only for PAdES revocation source
      Returns:
      list of RevocationTokens
    • getCompleteRevocationRefs

      public List<RevocationRef<R>> getCompleteRevocationRefs()
      Retrieves the list of all RevocationRefs present in the signature 'complete-revocation-references' attribute (used in CAdES and XAdES)
      Returns:
      list of RevocationRefs
    • getAttributeRevocationRefs

      public List<RevocationRef<R>> getAttributeRevocationRefs()
      Retrieves the list of all RevocationRefs present in the signature 'attribute-revocation-references' attribute (used in CAdES and XAdES)
      Returns:
      list of RevocationRefs
    • findRefsAndOriginsForRevocationToken

      public Map<RevocationRef<R>,Set<RevocationRefOrigin>> findRefsAndOriginsForRevocationToken(RevocationToken<R> revocationToken)
      Retrieves a Map of found RevocationRef with their origins for the given RevocationToken
      Parameters:
      revocationToken - RevocationToken to get references for
      Returns:
      Map of RevocationRefs with their origins
    • findRefsAndOriginsForBinary

      public Map<RevocationRef<R>,Set<RevocationRefOrigin>> findRefsAndOriginsForBinary(EncapsulatedRevocationTokenIdentifier<R> identifier)
      Retrieves a Map of orphan RevocationRef with their RevocationRefOrigins for a given EncapsulatedRevocationTokenIdentifier
      Parameters:
      identifier - EncapsulatedRevocationTokenIdentifier
      Returns:
      a Map of orphan references with their origins
    • findBinaryForReference

      public EncapsulatedRevocationTokenIdentifier<R> findBinaryForReference(RevocationRef<R> ref)
      Returns the linked EncapsulatedRevocationTokenIdentifier for a given RevocationRef
      Parameters:
      ref - the RevocationRef to find
      Returns:
      the related EncapsulatedRevocationTokenIdentifier
    • getOrphanRevocationReferencesWithOrigins

      public Map<RevocationRef<R>,Set<RevocationRefOrigin>> getOrphanRevocationReferencesWithOrigins()
      Retrieves a Map of orphan RevocationRef with their RevocationRefOrigins
      Returns:
      a Map of orphan references with their origins
    • isOrphan

      public boolean isOrphan(RevocationRef<R> reference)
      This method verifies if a given RevocationRef is an orphan (not linked to a complete RevocationToken
      Parameters:
      reference - the reference to be tested
      Returns:
      true if the given reference is an orphan
    • getAllReferencedRevocationBinaries

      public Set<EncapsulatedRevocationTokenIdentifier<R>> getAllReferencedRevocationBinaries()
      Retrieves the Set of tokens which have a reference
      Returns:
      a Set of Token Identifiers which are referenced
    • isEmpty

      public boolean isEmpty()
      This method checks if the revocation source is empty
      Returns:
      true if the source is empty