Package com.logicaldoc.sign.pdf
Class CreateSignature
java.lang.Object
com.logicaldoc.sign.pdf.CreateSignatureBase
com.logicaldoc.sign.pdf.CreateSignature
- All Implemented Interfaces:
- org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface
Signs a PDF with pdf box. A keystore can be created with the java keytool.
- Since:
- 7.7.2
- Author:
- Marco Meschieri - LogicalDOC
- 
Constructor SummaryConstructorsConstructorDescriptionCreateSignature(File ksFile, String keyStorePassword, String alias, String aliasPassword) Initialize the signature creator with a keystore and certficate password.
- 
Method SummaryModifier and TypeMethodDescriptionvoidSigns the given PDF filevoidsignDetached(org.apache.pdfbox.pdmodel.PDDocument document, OutputStream output, String name, String location, String reason) Methods inherited from class com.logicaldoc.sign.pdf.CreateSignatureBasegetMDPPermission, isExternalSigning, setCertificateChain, setExternalSigning, setMDPPermission, setPrivateKey, sign
- 
Constructor Details- 
CreateSignaturepublic CreateSignature(File ksFile, String keyStorePassword, String alias, String aliasPassword) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, CertificateException Initialize the signature creator with a keystore and certficate password.- Parameters:
- ksFile- the java keystore file containing the signing certificate
- keyStorePassword- the password for opening the keystore
- alias- the alias of the certificate
- aliasPassword- the password to open the alias
- Throws:
- NoSuchAlgorithmException- if the algorithm for recovering the key cannot be found
- UnrecoverableKeyException- if the given password is wrong
- CertificateException- if the certificate is not valid as signing time
- IOException- if no certificate could be found
- CertificateException- the digital certificate cannot be extracted
- KeyStoreException- error accessing the keystore
- UnrecoverableKeyException- error accessing the certificate
- NoSuchAlgorithmException- generic encryption issue
 
 
- 
- 
Method Details- 
signDetachedpublic void signDetached(File inFile, File outFile, String name, String location, String reason) throws IOException Signs the given PDF file- Parameters:
- inFile- input PDF file
- outFile- output PDF file
- name- name of the signer
- location- the location
- reason- the reason for signing
- Throws:
- IOException- if no certificate could be found
 
- 
signDetachedpublic void signDetached(org.apache.pdfbox.pdmodel.PDDocument document, OutputStream output, String name, String location, String reason) throws IOException - Throws:
- IOException
 
 
-