Class Policy

java.lang.Object
eu.europa.esig.dss.model.Policy
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
XmlPolicyWithTransforms

public class Policy extends Object implements Serializable
This class allows defining the signature policy.
See Also:
  • Constructor Details

    • Policy

      public Policy()
      Empty constructor
  • Method Details

    • getId

      public String getId()
      Get the signature policy (EPES)
      Returns:
      the policy id
    • setId

      public void setId(String id)
      Set the signature policy (EPES)
      Parameters:
      id - the policy id
    • getQualifier

      public ObjectIdentifierQualifier getQualifier()
      Get the identifier qualifier
      Returns:
      the qualifier
    • setQualifier

      public void setQualifier(ObjectIdentifierQualifier qualifier)
      Set the identifier qualifier (used in XAdES only)
      Parameters:
      qualifier - the qualifier
    • getDescription

      public String getDescription()
      Get the signature policy description
      Returns:
      the signature policy description
    • setDescription

      public void setDescription(String description)
      Set the signature policy description
      Parameters:
      description - the policy description
    • getDocumentationReferences

      public String[] getDocumentationReferences()
      Get the signature policy documentation references
      Returns:
      the signature policy documentation references
    • setDocumentationReferences

      public void setDocumentationReferences(String... documentationReferences)
      Set a list of signature documentation references
      Parameters:
      documentationReferences - an array of String documentation references
    • getDigestAlgorithm

      public DigestAlgorithm getDigestAlgorithm()
      Return the hash algorithm for the signature policy
      Returns:
      the used digest algorithm for the policy
    • setDigestAlgorithm

      public void setDigestAlgorithm(DigestAlgorithm digestAlgorithm)
      Set the hash algorithm for the explicit signature policy
      Parameters:
      digestAlgorithm - the used digest algorithm for the policy
    • getDigestValue

      public byte[] getDigestValue()
      Get the hash value of the explicit signature policy
      Returns:
      the digest value for the policy
    • setDigestValue

      public void setDigestValue(byte[] digestValue)
      Set the hash value of implicit signature policy
      Parameters:
      digestValue - the digest of the policy
    • getSpuri

      public String getSpuri()
      Get the SP URI (signature policy URI) qualifier
      Returns:
      the signature policy URI
    • setSpuri

      public void setSpuri(String spUri)
      Set the SP URI (signature policy URI) qualifier
      Parameters:
      spUri - the signature policy URI
    • getUserNotice

      public UserNotice getUserNotice()
      Gets the SP UserNotice qualifier
      Returns:
      UserNotice
    • setUserNotice

      public void setUserNotice(UserNotice userNotice)
      Sets the SP UserNotice qualifier
      Parameters:
      userNotice - UserNotice
    • getSpDocSpecification

      public SpDocSpecification getSpDocSpecification()
      Gets the SP Document Specification qualifier
      Returns:
      SpDocSpecification
    • setSpDocSpecification

      public void setSpDocSpecification(SpDocSpecification spDocSpecification)
      Sets the SP Document Specification qualifier identifying the technical specification that defines the syntax used for producing the signature policy.
      Parameters:
      spDocSpecification - SpDocSpecification
    • isHashAsInTechnicalSpecification

      public boolean isHashAsInTechnicalSpecification()
      Gets if the digests of the signature policy has been computed as in a technical specification
      Returns:
      TRUE if the digests has been computed as in a technical specification, FALSE otherwise
    • setHashAsInTechnicalSpecification

      public void setHashAsInTechnicalSpecification(boolean hashAsInTechnicalSpecification)
      Sets if the digests of the signature policy has been computed as in a technical specification. If the property is set to FALSE, digest of the signature policy is computed in a default way (on the policy file). NOTE: The property is used only in JAdES Use method setSpDocSpecification(SpDocSpecification) to provide the technical specification
      Parameters:
      hashAsInTechnicalSpecification - if the digests has been computed as in a technical specification
    • isEmpty

      public boolean isEmpty()
      Checks if the object's data is not filled
      Returns:
      TRUE if the Policy object does not have filled data, FALSE otherwise
    • isSPQualifierPresent

      public boolean isSPQualifierPresent()
      This method checks if there is a definition at least for one signature policy qualifier
      Returns:
      TRUE if there is a qualifier within the signature policy, FALSE otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object