Package eu.europa.esig.dss.model
Class Policy
java.lang.Object
eu.europa.esig.dss.model.Policy
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
XmlPolicyWithTransforms
This class allows defining the signature policy.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the signature policy descriptionReturn the hash algorithm for the signature policybyte[]Get the hash value of the explicit signature policyString[]Get the signature policy documentation referencesgetId()Get the signature policy (EPES)Get the identifier qualifierGets the SP Document Specification qualifiergetSpuri()Get the SP URI (signature policy URI) qualifierGets the SP UserNotice qualifierinthashCode()booleanisEmpty()Checks if the object's data is not filledbooleanGets if the digests of the signature policy has been computed as in a technical specificationbooleanThis method checks if there is a definition at least for one signature policy qualifiervoidsetDescription(String description) Set the signature policy descriptionvoidsetDigestAlgorithm(DigestAlgorithm digestAlgorithm) Set the hash algorithm for the explicit signature policyvoidsetDigestValue(byte[] digestValue) Set the hash value of implicit signature policyvoidsetDocumentationReferences(String... documentationReferences) Set a list of signature documentation referencesvoidsetHashAsInTechnicalSpecification(boolean hashAsInTechnicalSpecification) Sets if the digests of the signature policy has been computed as in a technical specification.voidSet the signature policy (EPES)voidsetQualifier(ObjectIdentifierQualifier qualifier) Set the identifier qualifier (used in XAdES only)voidsetSpDocSpecification(SpDocSpecification spDocSpecification) Sets the SP Document Specification qualifier identifying the technical specification that defines the syntax used for producing the signature policy.voidSet the SP URI (signature policy URI) qualifiervoidsetUserNotice(UserNotice userNotice) Sets the SP UserNotice qualifiertoString()
-
Constructor Details
-
Policy
public Policy()Empty constructor
-
-
Method Details
-
getId
-
setId
-
getQualifier
-
setQualifier
Set the identifier qualifier (used in XAdES only)- Parameters:
qualifier- the qualifier
-
getDescription
Get the signature policy description- Returns:
- the signature policy description
-
setDescription
Set the signature policy description- Parameters:
description- the policy description
-
getDocumentationReferences
Get the signature policy documentation references- Returns:
- the signature policy documentation references
-
setDocumentationReferences
-
getDigestAlgorithm
Return the hash algorithm for the signature policy- Returns:
- the used digest algorithm for the policy
-
setDigestAlgorithm
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
Get the SP URI (signature policy URI) qualifier- Returns:
- the signature policy URI
-
setSpuri
Set the SP URI (signature policy URI) qualifier- Parameters:
spUri- the signature policy URI
-
getUserNotice
-
setUserNotice
Sets the SP UserNotice qualifier- Parameters:
userNotice-UserNotice
-
getSpDocSpecification
Gets the SP Document Specification qualifier- Returns:
SpDocSpecification
-
setSpDocSpecification
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 methodsetSpDocSpecification(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
-
equals
-
toString
-