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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get 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 qualifierint
hashCode()
boolean
isEmpty()
Checks if the object's data is not filledboolean
Gets if the digests of the signature policy has been computed as in a technical specificationboolean
This method checks if there is a definition at least for one signature policy qualifiervoid
setDescription
(String description) Set the signature policy descriptionvoid
setDigestAlgorithm
(DigestAlgorithm digestAlgorithm) Set the hash algorithm for the explicit signature policyvoid
setDigestValue
(byte[] digestValue) Set the hash value of implicit signature policyvoid
setDocumentationReferences
(String... documentationReferences) Set a list of signature documentation referencesvoid
setHashAsInTechnicalSpecification
(boolean hashAsInTechnicalSpecification) Sets if the digests of the signature policy has been computed as in a technical specification.void
Set the signature policy (EPES)void
setQualifier
(ObjectIdentifierQualifier qualifier) Set the identifier qualifier (used in XAdES only)void
setSpDocSpecification
(SpDocSpecification spDocSpecification) Sets the SP Document Specification qualifier identifying the technical specification that defines the syntax used for producing the signature policy.void
Set the SP URI (signature policy URI) qualifiervoid
setUserNotice
(UserNotice userNotice) Sets the SP UserNotice qualifiertoString()
-
Constructor Details
-
Policy
public Policy()Empty constructor
-
-
Method Details
-
getId
Get the signature policy (EPES)- Returns:
- the policy id
-
setId
Set the signature policy (EPES)- Parameters:
id
- the policy id
-
getQualifier
Get the identifier qualifier- Returns:
- the qualifier
-
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
Set a list of signature documentation references- Parameters:
documentationReferences
- an array ofString
documentation references
-
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
Gets the SP UserNotice qualifier- Returns:
UserNotice
-
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
public int hashCode() -
equals
-
toString
-