public class CreateVisibleSignature extends CreateSignatureBase
CreateSignature| Constructor and Description |
|---|
CreateVisibleSignature(KeyStore keystore,
char[] pin)
Initialize the signature creator with a keystore (pkcs12) and pin that
should be used for the signature.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Arguments are
[0] key store
[1] pin
[2] document that will be signed
[3] image of visible signature
|
void |
setSignatureProperties(String name,
String location,
String reason,
int preferredSize,
int page,
boolean visualSignEnabled) |
void |
setVisibleSignatureProperties(String filename,
int x,
int y,
int zoomPercent,
FileInputStream image,
int page) |
void |
signPDF(File inputFile,
File signedFile)
Sign pdf file and create new file that ends with "_signed.pdf".
|
getTsaClient, setCertificate, setPrivateKey, setTsaClient, sign, signTimeStampspublic CreateVisibleSignature(KeyStore keystore, char[] pin) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException
keystore - is a pkcs12 keystore.pin - is the pin for the keystore / private keyKeyStoreExceptionUnrecoverableKeyExceptionNoSuchAlgorithmExceptionIOExceptionpublic void setVisibleSignatureProperties(String filename, int x, int y, int zoomPercent, FileInputStream image, int page) throws IOException
IOExceptionpublic void setSignatureProperties(String name, String location, String reason, int preferredSize, int page, boolean visualSignEnabled) throws IOException
IOExceptionpublic void signPDF(File inputFile, File signedFile) throws IOException
inputFile - The source pdf document file.signedFile - The file to be signed.IOExceptionpublic static void main(String[] args) throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableKeyException
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.