public class PDSignature extends java.lang.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
|
byte[] |
getContents(byte[] pdfFile)
Will return the embedded signature between the byterange gap.
|
byte[] |
getContents(java.io.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.
|
java.lang.String |
getFilter() |
java.lang.String |
getLocation() |
java.lang.String |
getName() |
java.lang.String |
getReason() |
java.util.Calendar |
getSignDate() |
byte[] |
getSignedContent(byte[] pdfFile)
Will return the signed content of the document.
|
byte[] |
getSignedContent(java.io.InputStream pdfFile)
Will return the signed content of the document.
|
java.lang.String |
getSubFilter() |
void |
setByteRange(int[] range) |
void |
setContents(byte[] bytes) |
void |
setFilter(COSName filter) |
void |
setLocation(java.lang.String location) |
void |
setName(java.lang.String name) |
void |
setReason(java.lang.String reason) |
void |
setSignDate(java.util.Calendar cal) |
void |
setSubFilter(COSName subfilter)
Set a subfilter that specify the signature that should be used.
|
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 setFilter(COSName filter)
public void setSubFilter(COSName subfilter)
subfilter
- the subfilter that shall be used.public void setName(java.lang.String name)
public void setLocation(java.lang.String location)
public void setReason(java.lang.String reason)
public void setSignDate(java.util.Calendar cal)
public java.lang.String getFilter()
public java.lang.String getSubFilter()
public java.lang.String getName()
public java.lang.String getLocation()
public java.lang.String getReason()
public java.util.Calendar getSignDate()
public void setByteRange(int[] range)
public int[] getByteRange()
public byte[] getContents(java.io.InputStream pdfFile) throws java.io.IOException
pdfFile
- The signed pdf file as InputStreamjava.io.IOException
- if the pdfFile can't be readpublic byte[] getContents(byte[] pdfFile) throws java.io.IOException
pdfFile
- The signed pdf file as byte arrayjava.io.IOException
- if the pdfFile can't be readpublic void setContents(byte[] bytes)
public byte[] getSignedContent(java.io.InputStream pdfFile) throws java.io.IOException
pdfFile
- The signed pdf file as InputStreamjava.io.IOException
- if the pdfFile can't be readpublic byte[] getSignedContent(byte[] pdfFile) throws java.io.IOException
pdfFile
- The signed pdf file as byte arrayjava.io.IOException
- if the pdfFile can't be read