Class CreateSignedTimeStamp
- java.lang.Object
-
- org.apache.pdfbox.examples.signature.CreateSignedTimeStamp
-
- All Implemented Interfaces:
org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface
public class CreateSignedTimeStamp extends java.lang.Object implements org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterfaceAn example for timestamp-signing a PDF for PADeS-Specification. The document will be extended by a signed TimeStamp (another kind of signature) (Signed TimeStamp and Hash-Value of the document are signed by a Time Stamp Authority (TSA)).- Author:
- Thomas Chojecki, Vakhtang Koroghlishvili, John Hewson, Alexis Suter
-
-
Constructor Summary
Constructors Constructor Description CreateSignedTimeStamp(java.lang.String tsaUrl)Initialize the signed timestamp creator
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] args)byte[]sign(java.io.InputStream content)voidsignDetached(java.io.File file)Signs the given PDF file.voidsignDetached(java.io.File inFile, java.io.File outFile)Signs the given PDF file.voidsignDetached(org.apache.pdfbox.pdmodel.PDDocument document, java.io.OutputStream output)Prepares the TimeStamp-Signature and starts the saving-process.
-
-
-
Method Detail
-
signDetached
public void signDetached(java.io.File file) throws java.io.IOExceptionSigns the given PDF file. Alters the original file on disk.- Parameters:
file- the PDF file to sign- Throws:
java.io.IOException- if the file could not be read or written
-
signDetached
public void signDetached(java.io.File inFile, java.io.File outFile) throws java.io.IOExceptionSigns the given PDF file.- Parameters:
inFile- input PDF fileoutFile- output PDF file- Throws:
java.io.IOException- if the input file could not be read
-
signDetached
public void signDetached(org.apache.pdfbox.pdmodel.PDDocument document, java.io.OutputStream output) throws java.io.IOExceptionPrepares the TimeStamp-Signature and starts the saving-process.- Parameters:
document- given Pdfoutput- Where the file will be written- Throws:
java.io.IOException
-
sign
public byte[] sign(java.io.InputStream content) throws java.io.IOException- Specified by:
signin interfaceorg.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.io.IOException- Throws:
java.io.IOException
-
-