public class PDSignature extends Object implements COSObjectable
Modifier and Type | Field and Description |
---|---|
static COSName |
FILTER_ADOBE_PPKLITE
A signature filter value.
|
static COSName |
FILTER_CICI_SIGNIT
A signature filter value.
|
static COSName |
FILTER_ENTRUST_PPKEF
A signature filter value.
|
static COSName |
FILTER_VERISIGN_PPKVS
A signature filter value.
|
static COSName |
SUBFILTER_ADBE_PKCS7_DETACHED
A signature subfilter value.
|
static COSName |
SUBFILTER_ADBE_PKCS7_SHA1
A signature subfilter value.
|
static COSName |
SUBFILTER_ADBE_X509_RSA_SHA1
A signature subfilter value.
|
static COSName |
SUBFILTER_ETSI_CADES_DETACHED
A signature subfilter value.
|
Constructor and Description |
---|
PDSignature()
Default constructor.
|
PDSignature(COSDictionary dict)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getByteRange()
Read out the byterange from the file.
|
String |
getContactInfo()
Returns the contact info.
|
byte[] |
getContents(byte[] pdfFile)
Will return the embedded signature between the byterange gap.
|
byte[] |
getContents(InputStream pdfFile)
Will return the embedded signature between the byterange gap.
|
COSBase |
getCOSObject()
Convert this standard java object to a COS object.
|
COSDictionary |
getDictionary()
Convert this standard java object to a COS dictionary.
|
String |
getFilter()
Returns the filter.
|
String |
getLocation()
Returns the location.
|
String |
getName()
Returns the name.
|
PDPropBuild |
getPropBuild()
PDF signature build dictionary.
|
String |
getReason()
Returns the reason.
|
Calendar |
getSignDate()
Returns the sign date.
|
byte[] |
getSignedContent(byte[] pdfFile)
Will return the signed content of the document.
|
byte[] |
getSignedContent(InputStream pdfFile)
Will return the signed content of the document.
|
String |
getSubFilter()
Returns the subfilter.
|
void |
setByteRange(int[] range)
Sets the byte range.
|
void |
setContactInfo(String contactInfo)
Sets the contact info.
|
void |
setContents(byte[] bytes)
Sets the contents.
|
void |
setFilter(COSName filter)
Set the filter.
|
void |
setLocation(String location)
Sets the location.
|
void |
setName(String name)
Sets the name.
|
void |
setPropBuild(PDPropBuild propBuild)
PDF signature build dictionary.
|
void |
setReason(String reason)
Sets the reason.
|
void |
setSignDate(Calendar cal)
Set the sign date.
|
void |
setSubFilter(COSName subfilter)
Set a subfilter that specify the signature that should be used.
|
void |
setType(COSName type)
Set the dictionary type.
|
public static final COSName FILTER_ADOBE_PPKLITE
public static final COSName FILTER_ENTRUST_PPKEF
public static final COSName FILTER_CICI_SIGNIT
public static final COSName FILTER_VERISIGN_PPKVS
public static final COSName SUBFILTER_ADBE_X509_RSA_SHA1
public static final COSName SUBFILTER_ADBE_PKCS7_DETACHED
public static final COSName SUBFILTER_ETSI_CADES_DETACHED
public static final COSName SUBFILTER_ADBE_PKCS7_SHA1
public PDSignature()
public PDSignature(COSDictionary dict)
dict
- The signature dictionary.public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
public COSDictionary getDictionary()
public void setType(COSName type)
type
- is the dictionary type.public void setFilter(COSName filter)
filter
- the filter to be usedpublic void setSubFilter(COSName subfilter)
subfilter
- the subfilter that shall be used.public void setName(String name)
name
- the name to be usedpublic void setLocation(String location)
location
- the location to be usedpublic void setReason(String reason)
reason
- the reason to be usedpublic void setContactInfo(String contactInfo)
contactInfo
- the contact info to be usedpublic void setSignDate(Calendar cal)
cal
- the date to be used as sign datepublic String getFilter()
public String getSubFilter()
public String getName()
public String getLocation()
public String getReason()
public String getContactInfo()
public Calendar getSignDate()
public void setByteRange(int[] range)
range
- the byte range to be usedpublic int[] getByteRange()
public byte[] getContents(InputStream pdfFile) throws IOException
pdfFile
- The signed pdf file as InputStreamIOException
- if the pdfFile can't be readpublic byte[] getContents(byte[] pdfFile) throws IOException
pdfFile
- The signed pdf file as byte arrayIOException
- if the pdfFile can't be readpublic void setContents(byte[] bytes)
bytes
- contents to be usedpublic byte[] getSignedContent(InputStream pdfFile) throws IOException
pdfFile
- The signed pdf file as InputStreamIOException
- if the pdfFile can't be readpublic byte[] getSignedContent(byte[] pdfFile) throws IOException
pdfFile
- The signed pdf file as byte arrayIOException
- if the pdfFile can't be readpublic PDPropBuild getPropBuild()
public void setPropBuild(PDPropBuild propBuild)
propBuild
- the prop buildCopyright © 2002-2015 The Apache Software Foundation. All Rights Reserved.