Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.digitalsignature

public Class PDSeedValue

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
java.util.Arrays, .Collections, .List, org.apache.pdfbox.cos.COSArray, .COSDictionary, .COSName, org.apache.pdfbox.pdmodel.common.COSObjectable

This represents a pdf signature seed value dictionary.
Author
Thomas Chojecki

Field Summary

Modifier and TypeField and Description
private static final List<String>
private final COSDictionary
public static final int
public static final int
public static final int
FLAG_FILTER

A Ff flag.

public static final int
FLAG_REASON

A Ff flag.

public static final int
FLAG_SUBFILTER

A Ff flag.

public static final int
FLAG_V

A Ff flag.

Constructor Summary

AccessConstructor and Description
public
PDSeedValue()

Default constructor.

public
PDSeedValue(COSDictionary
The signature dictionary.
dict
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public COSDictionary

Returns:

The COS dictionary that matches this Java object.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS dictionary.

public List<String>

Returns:

the digest method that shall be used by the signature handler
getDigestMethod
()

An array of names indicating acceptable digest algorithms to use when signing.

public String

Returns:

the filter that shall be used by the signature handler
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.

public List<String>

Returns:

the reasons that should be used by the signature handler
getLegalAttestation
()

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

public PDSeedValueMDP

Returns:

the mdp dictionary as 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.

public List<String>

Returns:

the reasons that should be used by the signature handler
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.

public PDSeedValueCertificate

Returns:

dictionary
getSeedValueCertificate
()

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

public List<String>

Returns:

the subfilter that shall be used by the signature handler
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.

public PDSeedValueTimeStamp

Returns:

the timestamp dictionary as PDSeedValueTimeStamp
getTimeStamp
()

(Optional; PDF 1.6) A time stamp dictionary containing two entries.

public float

Returns:

the minimum required capability of the signature field seed value dictionary parser
getV
()

The minimum required capability of the signature field seed value dictionary parser.

public boolean

Returns:

true if the AddRevInfo is required
isAddRevInfoRequired
()

public boolean

Returns:

true if the DigestMethod is required
isDigestMethodRequired
()

public boolean

Returns:

true if the Filter is required
isFilterRequired
()

public boolean

Returns:

true if the LegalAttestation is required
isLegalAttestationRequired
()

public boolean

Returns:

true if the Reason is required
isReasonRequired
()

public boolean

Returns:

true if the SubFilter is required
isSubFilterRequired
()

public boolean

Returns:

true if the V entry is required
isVRequired
()

public void
setAddRevInfoRequired(boolean
if true, the AddRevInfo shall be used.
flag
)

set true if the AddRevInfo shall be required.

public void
setDigestMethod(List<String>
is a list of possible names of the digests, that should be used for signing.
digestMethod
)

(Optional, PDF 1.7) An array of names indicating acceptable digest algorithms to use when signing.

public void
setDigestMethodRequired(boolean
if true, one digest from the array shall be used.
flag
)

set true if the DigestMethod shall be required.

public void
setFilter(COSName
is the filter that shall be used by the signature handler
filter
)

(Optional) The signature handler that shall be used to sign the signature field.

public void
setFilterRequired(boolean
if true, the specified Filter shall be used when signing.
flag
)

set true if the filter shall be required.

public void
setLegalAttestation(List<String>
is a list of possible text string that specifying possible legal attestations.
legalAttestation
)

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

public void
setLegalAttestationRequired(boolean
if true, the LegalAttestation entry shall be used.
flag
)

set true if the LegalAttestation shall be required.

public void
setMPD(PDSeedValueMDP
dictionary
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.

public void
setReasonRequired(boolean
if true, the Reason entry shall be used.
flag
)

set true if the Reason shall be required.

public void
setReasons(List<String>
is a list of possible text string that specifying possible reasons
reasons
)

(Optional) An array of text strings that specifying possible reasons for signing a document.

public void
setSeedValueCertificate(PDSeedValueCertificate
dictionary
certificate
)

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

public void
setSubFilter(List<String>
is the name that shall be used for encoding
subfilter
)

(Optional) An array of names indicating encodings to use when signing.

public void
setSubFilterRequired(boolean
if true, the first supported SubFilter in the array shall be used when signing.
flag
)

set true if the subfilter shall be required.

public void
setTimeStamp(PDSeedValueTimeStamp
dictionary
timestamp
)

(Optional; PDF 1.6) A time stamp dictionary containing two entries.

public void
setV(float
is the minimum required capability of the signature field seed value dictionary parser
minimumRequiredCapability
)

(Optional) The minimum required capability of the signature field seed value dictionary parser.

public void
setVRequired(boolean
if true, the V entry shall be used.
flag
)

set true if the V entry shall be required.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allowedDigestNamesback to summary
private static final List<String> allowedDigestNames
dictionaryback to summary
private final COSDictionary dictionary
FLAG_ADD_REV_INFOback to summary
public static final int FLAG_ADD_REV_INFO

A Ff flag.

FLAG_DIGEST_METHODback to summary
public static final int FLAG_DIGEST_METHOD

A Ff flag.

FLAG_FILTERback to summary
public static final int FLAG_FILTER

A Ff flag.

FLAG_REASONback to summary
public static final int FLAG_REASON

A Ff flag.

FLAG_SUBFILTERback to summary
public static final int FLAG_SUBFILTER

A Ff flag.

FLAG_Vback to summary
public static final int FLAG_V

A Ff flag.

Constructor Detail

PDSeedValueback to summary
public PDSeedValue()

Default constructor.

PDSeedValueback to summary
public PDSeedValue(COSDictionary dict)

Constructor.

Parameters
dict:COSDictionary

The signature dictionary.

Method Detail

getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

Convert this standard java object to a COS dictionary.

Returns:COSDictionary

The COS dictionary that matches this Java object.

Annotations
@Override
getDigestMethodback to summary
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:List<String>

the digest method that shall be used by the signature handler

getFilterback to summary
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:String

the filter that shall be used by the signature handler

getLegalAttestationback to summary
public List<String> getLegalAttestation()

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

Returns:List<String>

the reasons that should be used by the signature handler

getMDPback to summary
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:PDSeedValueMDP

the mdp dictionary as PDSeedValueMDP

getReasonsback to summary
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:List<String>

the reasons that should be used by the signature handler

getSeedValueCertificateback to summary
public PDSeedValueCertificate getSeedValueCertificate()

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

Returns:PDSeedValueCertificate

dictionary

getSubFilterback to summary
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:List<String>

the subfilter that shall be used by the signature handler

getTimeStampback to summary
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:PDSeedValueTimeStamp

the timestamp dictionary as PDSeedValueTimeStamp

getVback to summary
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:float

the minimum required capability of the signature field seed value dictionary parser

isAddRevInfoRequiredback to summary
public boolean isAddRevInfoRequired()
Returns:boolean

true if the AddRevInfo is required

isDigestMethodRequiredback to summary
public boolean isDigestMethodRequired()
Returns:boolean

true if the DigestMethod is required

isFilterRequiredback to summary
public boolean isFilterRequired()
Returns:boolean

true if the Filter is required

isLegalAttestationRequiredback to summary
public boolean isLegalAttestationRequired()
Returns:boolean

true if the LegalAttestation is required

isReasonRequiredback to summary
public boolean isReasonRequired()
Returns:boolean

true if the Reason is required

isSubFilterRequiredback to summary
public boolean isSubFilterRequired()
Returns:boolean

true if the SubFilter is required

isVRequiredback to summary
public boolean isVRequired()
Returns:boolean

true if the V entry is required

setAddRevInfoRequiredback to summary
public void setAddRevInfoRequired(boolean flag)

set true if the AddRevInfo shall be required.

Parameters
flag:boolean

if true, the AddRevInfo shall be used.

setDigestMethodback to summary
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:List<String>

is a list of possible names of the digests, that should be used for signing.

setDigestMethodRequiredback to summary
public void setDigestMethodRequired(boolean flag)

set true if the DigestMethod shall be required.

Parameters
flag:boolean

if true, one digest from the array shall be used.

setFilterback to summary
public void setFilter(COSName filter)

(Optional) The signature handler that shall be used to sign the signature field.

Parameters
filter:COSName

is the filter that shall be used by the signature handler

setFilterRequiredback to summary
public void setFilterRequired(boolean flag)

set true if the filter shall be required.

Parameters
flag:boolean

if true, the specified Filter shall be used when signing.

setLegalAttestationback to summary
public void setLegalAttestation(List<String> legalAttestation)

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

Parameters
legalAttestation:List<String>

is a list of possible text string that specifying possible legal attestations.

setLegalAttestationRequiredback to summary
public void setLegalAttestationRequired(boolean flag)

set true if the LegalAttestation shall be required.

Parameters
flag:boolean

if true, the LegalAttestation entry shall be used.

setMPDback to summary
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:PDSeedValueMDP

dictionary

setReasonRequiredback to summary
public void setReasonRequired(boolean flag)

set true if the Reason shall be required.

Parameters
flag:boolean

if true, the Reason entry shall be used.

setReasonsback to summary
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:List<String>

is a list of possible text string that specifying possible reasons

setSeedValueCertificateback to summary
public void setSeedValueCertificate(PDSeedValueCertificate certificate)

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

Parameters
certificate:PDSeedValueCertificate

dictionary

setSubFilterback to summary
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:List<String>

is the name that shall be used for encoding

setSubFilterRequiredback to summary
public void setSubFilterRequired(boolean flag)

set true if the subfilter shall be required.

Parameters
flag:boolean

if true, the first supported SubFilter in the array shall be used when signing.

setTimeStampback to summary
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:PDSeedValueTimeStamp

dictionary

setVback to summary
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:float

is the minimum required capability of the signature field seed value dictionary parser

setVRequiredback to summary
public void setVRequired(boolean flag)

set true if the V entry shall be required.

Parameters
flag:boolean

if true, the V entry shall be used.