Class SignaturePolicyProvider

java.lang.Object
eu.europa.esig.dss.validation.SignaturePolicyProvider

public class SignaturePolicyProvider extends Object
The class is used to retrieve a policy by its SignaturePolicyIdentifier
  • Constructor Details

    • SignaturePolicyProvider

      public SignaturePolicyProvider()
      Default constructor instantiating object with null data loaded and empty maps
  • Method Details

    • setDataLoader

      public void setDataLoader(DataLoader dataLoader)
      Sets the DataLoader to retrieve signature policy documents (e.g. from online)
      Parameters:
      dataLoader - DataLoader
    • setSignaturePoliciesById

      public void setSignaturePoliciesById(Map<String,DSSDocument> signaturePoliciesById)
      Sets the map of signature policy documents to retrieve by IDs
      Parameters:
      signaturePoliciesById - a map of signature policy documents by IDs
    • setSignaturePoliciesByUrl

      public void setSignaturePoliciesByUrl(Map<String,DSSDocument> signaturePoliciesByUrl)
      Sets the map of signature policy documents to retrieve by URLs
      Parameters:
      signaturePoliciesByUrl - a map of signature policy documents by URLs
    • getSignaturePolicyById

      public DSSDocument getSignaturePolicyById(String policyId)
      Gets a signature policy document with the corresponding policyId from signaturePoliciesById map
      Parameters:
      policyId - String id to retrieve a signaturePolicy with
      Returns:
      DSSDocument signature policy content if found, null otherwise
    • getSignaturePolicyByUrl

      public DSSDocument getSignaturePolicyByUrl(String url)
      Gets a signature policy document with the corresponding url from signaturePoliciesByUrl map, if not found, retrieved the data from url with dataLoader
      Parameters:
      url - String url to retrieve a signaturePolicy with
      Returns:
      DSSDocument signature policy content if found, null otherwise
    • getSignaturePolicy

      public DSSDocument getSignaturePolicy(String policyId, String url)
      Gets signature policy by all available ways (id and uri)
      Parameters:
      policyId - String policy id
      url - String policy url
      Returns:
      DSSDocument signature policy content if found, null otherwise