Package eu.europa.esig.dss.pdf
Class PdfSigDictWrapper
java.lang.Object
eu.europa.esig.dss.pdf.PdfSigDictWrapper
- All Implemented Interfaces:
PdfSignatureDictionary
The default implementation of
PdfSignatureDictionary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default constructorPdfSigDictWrapper
(PdfDict dictionary) Deprecated.since DSS 6.3. -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkConsistency
(PdfSignatureDictionary signatureDictionary) Verifies the equality of the current PdfSignatureDictionary with providedsignatureDictionary
.Gets the signed/timestamped ByteRangegetCMS()
Gets the CMS from /ContentsGets the signer's contact infobyte[]
Gets /Contents binaries (CMSSignedData)Returns a /DocMDP dictionary, when presentReturns a /FieldMDP dictionary, when presentGets the Filter valueGets the signer's locationGets the signing reasonGets name of the signerGets the claimed signing timeGets the SubFilter valuegetType()
Gets type of the dictionaryboolean
Checks if the signature dictionary is consistent.protected void
setByteRange
(ByteRange byteRange) Sets the /ByteRange valueprotected void
Sets the CMS value read from /Contentsprotected void
setContactInfo
(String contactInfo) Sets the contact infoprotected void
setContents
(byte[] contents) Sets the /Contents signature valueprotected void
setDictionary
(PdfDict dictionary) Sets the signature field dictionaryprotected void
setDocMDP
(CertificationPermission docMDP) Sets the /DocMPD dictionary valueprotected void
setFieldMDP
(SigFieldPermissions fieldMDP) Sets the /FieldMDP dictionary valueprotected void
Sets the /Filter valueprotected void
setLocation
(String location) Sets the signer locationprotected void
Sets the signing reasonprotected void
setSignerName
(String signerName) Sets the name of the signerprotected void
setSigningDate
(Date signingDate) Sets the date of signingprotected void
setSubFilter
(String subFilter) Sets the /SubFilter valueprotected void
Sets the type of the dictionary
-
Constructor Details
-
PdfSigDictWrapper
protected PdfSigDictWrapper()Default constructor -
PdfSigDictWrapper
Deprecated.since DSS 6.3. Please usenew PdfSigDictWrapperFactory(sigFieldDictionary)#create
insteadDefault constructor- Parameters:
dictionary
-PdfDict
-
-
Method Details
-
setDictionary
Sets the signature field dictionary- Parameters:
dictionary
-PdfDict
-
getSignerName
Description copied from interface:PdfSignatureDictionary
Gets name of the signer- Specified by:
getSignerName
in interfacePdfSignatureDictionary
- Returns:
String
-
setSignerName
Sets the name of the signer- Parameters:
signerName
-String
-
getContactInfo
Description copied from interface:PdfSignatureDictionary
Gets the signer's contact info- Specified by:
getContactInfo
in interfacePdfSignatureDictionary
- Returns:
String
-
setContactInfo
Sets the contact info- Parameters:
contactInfo
-String
-
getReason
Description copied from interface:PdfSignatureDictionary
Gets the signing reason- Specified by:
getReason
in interfacePdfSignatureDictionary
- Returns:
String
-
setReason
Sets the signing reason- Parameters:
reason
-String
-
getLocation
Description copied from interface:PdfSignatureDictionary
Gets the signer's location- Specified by:
getLocation
in interfacePdfSignatureDictionary
- Returns:
String
-
setLocation
Sets the signer location- Parameters:
location
-String
-
getSigningDate
Description copied from interface:PdfSignatureDictionary
Gets the claimed signing time- Specified by:
getSigningDate
in interfacePdfSignatureDictionary
- Returns:
Date
-
setSigningDate
Sets the date of signing- Parameters:
signingDate
-Date
-
getType
Description copied from interface:PdfSignatureDictionary
Gets type of the dictionary- Specified by:
getType
in interfacePdfSignatureDictionary
- Returns:
String
-
setType
Sets the type of the dictionary- Parameters:
type
-String
-
getFilter
Description copied from interface:PdfSignatureDictionary
Gets the Filter value- Specified by:
getFilter
in interfacePdfSignatureDictionary
- Returns:
String
-
setFilter
Sets the /Filter value- Parameters:
filter
-String
-
getSubFilter
Description copied from interface:PdfSignatureDictionary
Gets the SubFilter value- Specified by:
getSubFilter
in interfacePdfSignatureDictionary
- Returns:
String
-
setSubFilter
Sets the /SubFilter value- Parameters:
subFilter
-String
-
getContents
public byte[] getContents()Description copied from interface:PdfSignatureDictionary
Gets /Contents binaries (CMSSignedData)- Specified by:
getContents
in interfacePdfSignatureDictionary
- Returns:
- /Contents binaries
-
setContents
protected void setContents(byte[] contents) Sets the /Contents signature value- Parameters:
contents
- byte array
-
getByteRange
Description copied from interface:PdfSignatureDictionary
Gets the signed/timestamped ByteRange- Specified by:
getByteRange
in interfacePdfSignatureDictionary
- Returns:
ByteRange
-
setByteRange
Sets the /ByteRange value- Parameters:
byteRange
-ByteRange
-
getDocMDP
Description copied from interface:PdfSignatureDictionary
Returns a /DocMDP dictionary, when present- Specified by:
getDocMDP
in interfacePdfSignatureDictionary
- Returns:
CertificationPermission
-
setDocMDP
Sets the /DocMPD dictionary value- Parameters:
docMDP
-CertificationPermission
-
getFieldMDP
Description copied from interface:PdfSignatureDictionary
Returns a /FieldMDP dictionary, when present- Specified by:
getFieldMDP
in interfacePdfSignatureDictionary
- Returns:
SigFieldPermissions
-
setFieldMDP
Sets the /FieldMDP dictionary value- Parameters:
fieldMDP
-SigFieldPermissions
-
getCMS
Description copied from interface:PdfSignatureDictionary
Gets the CMS from /Contents- Specified by:
getCMS
in interfacePdfSignatureDictionary
- Returns:
CMS
-
setCMS
Sets the CMS value read from /Contents- Parameters:
cms
-CMS
-
checkConsistency
Description copied from interface:PdfSignatureDictionary
Verifies the equality of the current PdfSignatureDictionary with providedsignatureDictionary
. NOTE: this method is similar toequals(PdfSignatureDictionary)
method, but also modifies the state of the object accessible fromisConsistent()
method. If none signature dictionary found in the signed revision, NULL may be provided.- Specified by:
checkConsistency
in interfacePdfSignatureDictionary
- Parameters:
signatureDictionary
-PdfSignatureDictionary
to compare with- Returns:
- TRUE if the
PdfSignatureDictionary
is equal to the providedsignatureDictionary
, FALSE otherwise
-
isConsistent
public boolean isConsistent()Description copied from interface:PdfSignatureDictionary
Checks if the signature dictionary is consistent. NOTE: methodcheckConsistency(PdfSignatureDictionary)
shall be executed before!- Specified by:
isConsistent
in interfacePdfSignatureDictionary
- Returns:
- TRUE if the
PdfSignatureDictionary
is consistent, FALSE otherwise
-