public class CreateVisibleSignature2 extends CreateSignatureBase
Constructor and Description |
---|
CreateVisibleSignature2(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 |
---|---|
File |
getImageFile() |
boolean |
isLateExternalSigning() |
static void |
main(String[] args)
Arguments are
[0] key store
[1] pin
[2] document that will be signed
[3] image of visible signature
|
void |
setImageFile(File imageFile) |
void |
setLateExternalSigning(boolean lateExternalSigning)
Set late external signing.
|
void |
signPDF(File inputFile,
File signedFile,
Rectangle2D humanRect,
String tsaUrl)
Sign pdf file and create new file that ends with "_signed.pdf".
|
void |
signPDF(File inputFile,
File signedFile,
Rectangle2D humanRect,
String tsaUrl,
String signatureFieldName)
Sign pdf file and create new file that ends with "_signed.pdf".
|
isExternalSigning, setCertificateChain, setExternalSigning, setPrivateKey, setTsaUrl, sign
public CreateVisibleSignature2(KeyStore keystore, char[] pin) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, CertificateException
keystore
- is a pkcs12 keystore.pin
- is the pin for the keystore / private keyKeyStoreException
- if the keystore has not been initialized (loaded)NoSuchAlgorithmException
- if the algorithm for recovering the key cannot be foundUnrecoverableKeyException
- if the given password is wrongCertificateException
- if the certificate is not valid as signing timeIOException
- if no certificate could be foundpublic File getImageFile()
public void setImageFile(File imageFile)
public boolean isLateExternalSigning()
public void setLateExternalSigning(boolean lateExternalSigning)
lateExternalSigning
- public void signPDF(File inputFile, File signedFile, Rectangle2D humanRect, String tsaUrl) throws IOException
inputFile
- The source pdf document file.signedFile
- The file to be signed.humanRect
- rectangle from a human viewpoint (coordinates start at top left)tsaUrl
- optional TSA urlIOException
public void signPDF(File inputFile, File signedFile, Rectangle2D humanRect, String tsaUrl, String signatureFieldName) throws IOException
inputFile
- The source pdf document file.signedFile
- The file to be signed.humanRect
- rectangle from a human viewpoint (coordinates start at top left)tsaUrl
- optional TSA urlsignatureFieldName
- optional name of an existing (unsigned) signature fieldIOException
public static void main(String[] args) throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableKeyException
args
- KeyStoreException
CertificateException
IOException
NoSuchAlgorithmException
UnrecoverableKeyException
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.