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 Object
implements org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface
An 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
ConstructorsConstructorDescriptionCreateSignedTimeStamp(String tsaUrl) Initialize the signed timestamp creator -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbyte[]sign(InputStream content) voidsignDetached(File file) Signs the given PDF file.voidsignDetached(File inFile, File outFile) Signs the given PDF file.voidsignDetached(org.apache.pdfbox.pdmodel.PDDocument document, OutputStream output) Prepares the TimeStamp-Signature and starts the saving-process.
-
Constructor Details
-
CreateSignedTimeStamp
Initialize the signed timestamp creator- Parameters:
tsaUrl- The url where TS-Request will be done.
-
-
Method Details
-
signDetached
Signs the given PDF file. Alters the original file on disk.- Parameters:
file- the PDF file to sign- Throws:
IOException- if the file could not be read or written
-
signDetached
Signs the given PDF file.- Parameters:
inFile- input PDF fileoutFile- output PDF file- Throws:
IOException- if the input file could not be read
-
signDetached
public void signDetached(org.apache.pdfbox.pdmodel.PDDocument document, OutputStream output) throws IOException Prepares the TimeStamp-Signature and starts the saving-process.- Parameters:
document- given Pdfoutput- Where the file will be written- Throws:
IOException
-
sign
- Specified by:
signin interfaceorg.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface- Throws:
IOException
-
main
- Throws:
IOException
-