org.apache.pdfbox.pdmodel.interactive.digitalsignature

## Class PDSeedValue

- java.lang.Object
- - org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSeedValue

All Implemented Interfaces:
  COSObjectable

    public class PDSeedValue
    extends Object
    implements COSObjectable

This represents a pdf signature seed value dictionary.

Author:
  Thomas Chojecki

### Field Summary

Fields
`static int` `FLAG_ADD_REV_INFO` A Ff flag.
`static int` `FLAG_DIGEST_METHOD` A Ff flag.
`static int` `FLAG_FILTER` A Ff flag.
`static int` `FLAG_LEGAL_ATTESTATION` A Ff flag.
`static int` `FLAG_REASON` A Ff flag.
`static int` `FLAG_SUBFILTER` A Ff flag.
`static int` `FLAG_V` A Ff flag.

### Constructor Summary

Constructors
Constructor and Description
`PDSeedValue()` Default constructor.
`PDSeedValue(COSDictionary dict)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`COSDictionary` `getCOSObject()` Convert this standard java object to a COS dictionary.
`List<String>` `getDigestMethod()` An array of names indicating acceptable digest algorithms to use when signing.
`String` `getFilter()` If Filter is not null and the `isFilterRequired()` 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.
`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.
`List<String>` `getReasons()` If the Reasons array is provided and `isReasonRequired()` 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.
`PDSeedValueCertificate` `getSeedValueCertificate()` (Optional) A certificate seed value dictionary containing information about the certificate to be used when signing.
`List<String>` `getSubFilter()` If SubFilter is not null and the `isSubFilterRequired()` indicates this entry is a required constraint, then the first matching encodings shall be used when signing; otherwise, signing shall not take place.
`PDSeedValueTimeStamp` `getTimeStamp()` (Optional; PDF 1.6) A time stamp dictionary containing two entries.
`float` `getV()` The minimum required capability of the signature field seed value dictionary parser.
`boolean` `isAddRevInfoRequired()`
`boolean` `isDigestMethodRequired()`
`boolean` `isFilterRequired()`
`boolean` `isLegalAttestationRequired()`
`boolean` `isReasonRequired()`
`boolean` `isSubFilterRequired()`
`boolean` `isVRequired()`
`void` `setAddRevInfoRequired(boolean flag)` set true if the AddRevInfo shall be required.
`void` `setDigestMethod(List<String> digestMethod)` (Optional, PDF 1.7) An array of names indicating acceptable digest algorithms to use when signing.
`void` `setDigestMethodRequired(boolean flag)` set true if the DigestMethod shall be required.
`void` `setFilter(COSName filter)` (Optional) The signature handler that shall be used to sign the signature field.
`void` `setFilterRequired(boolean flag)` set true if the filter shall be required.
`void` `setLegalAttestation(List<String> legalAttestation)` (Optional, PDF 1.6) An array of text strings that specifying possible legal attestations.
`void` `setLegalAttestationRequired(boolean flag)` set true if the LegalAttestation shall be required.
`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.
`void` `setReasonRequired(boolean flag)` set true if the Reason shall be required.
`void` `setReasons(List<String> reasons)` (Optional) An array of text strings that specifying possible reasons for signing a document.
`void` `setSeedValueCertificate(PDSeedValueCertificate certificate)` (Optional) A certificate seed value dictionary containing information about the certificate to be used when signing.
`void` `setSubFilter(List<String> subfilter)` (Optional) An array of names indicating encodings to use when signing.
`void` `setSubFilterRequired(boolean flag)` set true if the subfilter shall be required.
`void` `setTimeStamp(PDSeedValueTimeStamp timestamp)` (Optional; PDF 1.6) A time stamp dictionary containing two entries.
`void` `setV(float minimumRequiredCapability)` (Optional) The minimum required capability of the signature field seed value dictionary parser.
`void` `setVRequired(boolean flag)` set true if the V entry shall be required.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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:
  `getCOSObject` in interface `COSObjectable`
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 the `isFilterRequired()` 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. If `isFilterRequired()` 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 the `isSubFilterRequired()` indicates this entry is a required constraint, then the first matching encodings shall be used when signing; otherwise, signing shall not take place. If `isSubFilterRequired()` 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<String> 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<String> 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 and `isReasonRequired()` 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 the `isReasonRequired()` 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

#### setReasons

    public void setReasons(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

#### getSeedValueCertificate

    public PDSeedValueCertificate getSeedValueCertificate()

(Optional) A certificate seed value dictionary containing information about the certificate to be used when signing.

Returns:
  dictionary

#### setSeedValueCertificate

    public void setSeedValueCertificate(PDSeedValueCertificate certificate)

(Optional) A certificate seed value dictionary containing information about the certificate to be used when signing.

Parameters:
  `certificate` - 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

#### setLegalAttestation

    public void setLegalAttestation(List<String> legalAttestation)

(Optional, PDF 1.6) An array of text strings that specifying possible legal attestations.

Parameters:
  `legalAttestation` - is a list of possible text string that specifying possible legal attestations.