Class PDSeedValue
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.interactive.digitalsignature.PDSeedValue
-
- All Implemented Interfaces:
COSObjectable
public class PDSeedValue extends Object implements COSObjectable
This represents a pdf signature seed value dictionary.
-
-
Field Summary
Fields Modifier and Type Field Description static intFLAG_ADD_REV_INFOA Ff flag.static intFLAG_DIGEST_METHODA Ff flag.static intFLAG_FILTERA Ff flag.static intFLAG_LEGAL_ATTESTATIONA Ff flag.static intFLAG_REASONA Ff flag.static intFLAG_SUBFILTERA Ff flag.static intFLAG_VA Ff flag.
-
Constructor Summary
Constructors Constructor Description PDSeedValue()Default constructor.PDSeedValue(COSDictionary dict)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description COSDictionarygetCOSObject()Convert this standard java object to a COS dictionary.List<String>getDigestMethod()An array of names indicating acceptable digest algorithms to use when signing.StringgetFilter()If Filter is not null and theisFilterRequired()indicates this entry is a required constraint, then the signature handler specified by this entry shall be used when signing; otherwise, signing shall not take place.List<String>getLegalAttestation()(Optional, PDF 1.6) An array of text strings that specifying possible legal attestations.PDSeedValueMDPgetMDP()(Optional; PDF 1.6) A dictionary containing a single entry whose key is P and whose value is an integer between 0 and 3.List<String>getReasons()If the Reasons array is provided andisReasonRequired()indicates that Reasons is a required constraint, one of the reasons in the array shall be used for the signature dictionary; otherwise signing shall not take place.List<String>getSubFilter()If SubFilter is not null and theisSubFilterRequired()indicates this entry is a required constraint, then the first matching encodings shall be used when signing; otherwise, signing shall not take place.PDSeedValueTimeStampgetTimeStamp()(Optional; PDF 1.6) A time stamp dictionary containing two entries.floatgetV()The minimum required capability of the signature field seed value dictionary parser.booleanisAddRevInfoRequired()booleanisDigestMethodRequired()booleanisFilterRequired()booleanisLegalAttestationRequired()booleanisReasonRequired()booleanisSubFilterRequired()booleanisVRequired()voidsetAddRevInfoRequired(boolean flag)set true if the AddRevInfo shall be required.voidsetDigestMethod(List<COSName> digestMethod)(Optional, PDF 1.7) An array of names indicating acceptable digest algorithms to use when signing.voidsetDigestMethodRequired(boolean flag)set true if the DigestMethod shall be required.voidsetFilter(COSName filter)(Optional) The signature handler that shall be used to sign the signature field.voidsetFilterRequired(boolean flag)set true if the filter shall be required.voidsetLegalAttestation(List<String> legalAttestation)(Optional, PDF 1.6) An array of text strings that specifying possible legal attestations.voidsetLegalAttestationRequired(boolean flag)set true if the LegalAttestation shall be required.voidsetMPD(PDSeedValueMDP mdp)(Optional; PDF 1.6) A dictionary containing a single entry whose key is P and whose value is an integer between 0 and 3.voidsetReasonRequired(boolean flag)set true if the Reason shall be required.voidsetReasonsd(List<String> reasons)(Optional) An array of text strings that specifying possible reasons for signing a document.voidsetSubFilter(List<COSName> subfilter)(Optional) An array of names indicating encodings to use when signing.voidsetSubFilterRequired(boolean flag)set true if the subfilter shall be required.voidsetTimeStamp(PDSeedValueTimeStamp timestamp)(Optional; PDF 1.6) A time stamp dictionary containing two entries.voidsetV(float minimumRequiredCapability)(Optional) The minimum required capability of the signature field seed value dictionary parser.voidsetVRequired(boolean flag)set true if the V entry shall be required.
-
-
-
Field Detail
-
FLAG_FILTER
public static final int FLAG_FILTER
A Ff flag.- See Also:
- Constant Field Values
-
FLAG_SUBFILTER
public static final int FLAG_SUBFILTER
A Ff flag.- See Also:
- Constant Field Values
-
FLAG_V
public static final int FLAG_V
A Ff flag.- See Also:
- Constant Field Values
-
FLAG_REASON
public static final int FLAG_REASON
A Ff flag.- See Also:
- Constant Field Values
-
FLAG_LEGAL_ATTESTATION
public static final int FLAG_LEGAL_ATTESTATION
A Ff flag.- See Also:
- Constant Field Values
-
FLAG_ADD_REV_INFO
public static final int FLAG_ADD_REV_INFO
A Ff flag.- See Also:
- Constant Field Values
-
FLAG_DIGEST_METHOD
public static final int FLAG_DIGEST_METHOD
A Ff flag.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDSeedValue
public PDSeedValue()
Default constructor.
-
PDSeedValue
public PDSeedValue(COSDictionary dict)
Constructor.- Parameters:
dict- The signature dictionary.
-
-
Method Detail
-
getCOSObject
public COSDictionary getCOSObject()
Convert this standard java object to a COS dictionary.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The COS dictionary that matches this Java object.
-
isFilterRequired
public boolean isFilterRequired()
- Returns:
- true if the Filter is required
-
setFilterRequired
public void setFilterRequired(boolean flag)
set true if the filter shall be required.- Parameters:
flag- if true, the specified Filter shall be used when signing.
-
isSubFilterRequired
public boolean isSubFilterRequired()
- Returns:
- true if the SubFilter is required
-
setSubFilterRequired
public void setSubFilterRequired(boolean flag)
set true if the subfilter shall be required.- Parameters:
flag- if true, the first supported SubFilter in the array shall be used when signing.
-
isDigestMethodRequired
public boolean isDigestMethodRequired()
- Returns:
- true if the DigestMethod is required
-
setDigestMethodRequired
public void setDigestMethodRequired(boolean flag)
set true if the DigestMethod shall be required.- Parameters:
flag- if true, one digest from the array shall be used.
-
isVRequired
public boolean isVRequired()
- Returns:
- true if the V entry is required
-
setVRequired
public void setVRequired(boolean flag)
set true if the V entry shall be required.- Parameters:
flag- if true, the V entry shall be used.
-
isReasonRequired
public boolean isReasonRequired()
- Returns:
- true if the Reason is required
-
setReasonRequired
public void setReasonRequired(boolean flag)
set true if the Reason shall be required.- Parameters:
flag- if true, the Reason entry shall be used.
-
isLegalAttestationRequired
public boolean isLegalAttestationRequired()
- Returns:
- true if the LegalAttestation is required
-
setLegalAttestationRequired
public void setLegalAttestationRequired(boolean flag)
set true if the LegalAttestation shall be required.- Parameters:
flag- if true, the LegalAttestation entry shall be used.
-
isAddRevInfoRequired
public boolean isAddRevInfoRequired()
- Returns:
- true if the AddRevInfo is required
-
setAddRevInfoRequired
public void setAddRevInfoRequired(boolean flag)
set true if the AddRevInfo shall be required.- Parameters:
flag- if true, the AddRevInfo shall be used.
-
getFilter
public String getFilter()
If Filter is not null and theisFilterRequired()indicates this entry is a required constraint, then the signature handler specified by this entry shall be used when signing; otherwise, signing shall not take place. IfisFilterRequired()indicates that this is an optional constraint, this handler may be used if it is available. If it is not available, a different handler may be used instead.- Returns:
- the filter that shall be used by the signature handler
-
setFilter
public void setFilter(COSName filter)
(Optional) The signature handler that shall be used to sign the signature field.- Parameters:
filter- is the filter that shall be used by the signature handler
-
getSubFilter
public List<String> getSubFilter()
If SubFilter is not null and theisSubFilterRequired()indicates this entry is a required constraint, then the first matching encodings shall be used when signing; otherwise, signing shall not take place. IfisSubFilterRequired()indicates that this is an optional constraint, then the first matching encoding shall be used if it is available. If it is not available, a different encoding may be used instead.- Returns:
- the subfilter that shall be used by the signature handler
-
setSubFilter
public void setSubFilter(List<COSName> subfilter)
(Optional) An array of names indicating encodings to use when signing. The first name in the array that matches an encoding supported by the signature handler shall be the encoding that is actually used for signing.- Parameters:
subfilter- is the name that shall be used for encoding
-
getDigestMethod
public List<String> getDigestMethod()
An array of names indicating acceptable digest algorithms to use when signing. The value shall be one of SHA1, SHA256, SHA384, SHA512, RIPEMD160. The default value is implementation-specific.- Returns:
- the digest method that shall be used by the signature handler
-
setDigestMethod
public void setDigestMethod(List<COSName> digestMethod)
(Optional, PDF 1.7) An array of names indicating acceptable digest algorithms to use when signing. The value shall be one of SHA1, SHA256, SHA384, SHA512, RIPEMD160. The default value is implementation-specific.
This property is only applicable if the digital credential signing contains RSA public/privat keys
- Parameters:
digestMethod- is a list of possible names of the digests, that should be used for signing.
-
getV
public float getV()
The minimum required capability of the signature field seed value dictionary parser. A value of 1 specifies that the parser shall be able to recognize all seed value dictionary entries in a PDF 1.5 file. A value of 2 specifies that it shall be able to recognize all seed value dictionary entries specified.- Returns:
- the minimum required capability of the signature field seed value dictionary parser
-
setV
public void setV(float minimumRequiredCapability)
(Optional) The minimum required capability of the signature field seed value dictionary parser. A value of 1 specifies that the parser shall be able to recognize all seed value dictionary entries in a PDF 1.5 file. A value of 2 specifies that it shall be able to recognize all seed value dictionary entries specified.- Parameters:
minimumRequiredCapability- is the minimum required capability of the signature field seed value dictionary parser
-
getReasons
public List<String> getReasons()
If the Reasons array is provided andisReasonRequired()indicates that Reasons is a required constraint, one of the reasons in the array shall be used for the signature dictionary; otherwise signing shall not take place. If theisReasonRequired()indicates Reasons is an optional constraint, one of the reasons in the array may be chose or a custom reason can be provided.- Returns:
- the reasons that should be used by the signature handler
-
setReasonsd
public void setReasonsd(List<String> reasons)
(Optional) An array of text strings that specifying possible reasons for signing a document. If specified, the reasons supplied in this entry replace those used by conforming products.- Parameters:
reasons- is a list of possible text string that specifying possible reasons
-
getMDP
public PDSeedValueMDP getMDP()
(Optional; PDF 1.6) A dictionary containing a single entry whose key is P and whose value is an integer between 0 and 3. A value of 0 defines the signatures as an author signature. The value 1 through 3 shall be used for certification signatures and correspond to the value of P in a DocMDP transform parameters dictionary.
If this MDP key is not present or the MDP dictionary does not contain a P entry, no rules shall be defined regarding the type of signature or its permissions.
- Returns:
- the mdp dictionary as PDSeedValueMDP
-
setMPD
public void setMPD(PDSeedValueMDP mdp)
(Optional; PDF 1.6) A dictionary containing a single entry whose key is P and whose value is an integer between 0 and 3. A value of 0 defines the signatures as an author signature. The value 1 through 3 shall be used for certification signatures and correspond to the value of P in a DocMDP transform parameters dictionary.
If this MDP key is not present or the MDP dictionary does not contain a P entry, no rules shall be defined regarding the type of signature or its permissions.
- Parameters:
mdp- dictionary
-
getTimeStamp
public PDSeedValueTimeStamp getTimeStamp()
(Optional; PDF 1.6) A time stamp dictionary containing two entries. URL which is a ASCII string specifying the URL to a rfc3161 conform timestamp server and Ff to indicate if a timestamp is required or optional.
- Returns:
- the timestamp dictionary as PDSeedValueTimeStamp
-
setTimeStamp
public void setTimeStamp(PDSeedValueTimeStamp timestamp)
(Optional; PDF 1.6) A time stamp dictionary containing two entries. URL which is a ASCII string specifying the URL to a rfc3161 conform timestamp server and Ff to indicate if a timestamp is required or optional.
- Parameters:
timestamp- dictionary
-
getLegalAttestation
public List<String> getLegalAttestation()
(Optional, PDF 1.6) An array of text strings that specifying possible legal attestations.- Returns:
- the reasons that should be used by the signature handler
-
-