Class PDSeedValue

  • All Implemented Interfaces:
    COSObjectable

    public class PDSeedValue
    extends java.lang.Object
    implements COSObjectable
    This represents a pdf signature seed value dictionary.
    • 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 java.lang.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 java.util.List<java.lang.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​(java.util.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 java.util.List<java.lang.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​(java.util.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 java.util.List<java.lang.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
      • setReasonsd

        @Deprecated
        public void setReasonsd​(java.util.List<java.lang.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
      • setReasons

        public void setReasons​(java.util.List<java.lang.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 java.util.List<java.lang.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​(java.util.List<java.lang.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.