public abstract class CreateSignatureBase extends Object implements SignatureInterface
Constructor and Description |
---|
CreateSignatureBase(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 |
---|---|
int |
getMDPPermission(PDDocument doc)
Get the access permissions granted for this document in the DocMDP transform parameters
dictionary.
|
TSAClient |
getTsaClient() |
boolean |
isExternalSigning() |
void |
setCertificate(Certificate certificate) |
void |
setCertificateChain(Certificate[] certificateChain) |
void |
setExternalSigning(boolean externalSigning)
Set if external signing scenario should be used.
|
void |
setMDPPermission(PDDocument doc,
PDSignature signature,
int accessPermissions) |
void |
setPrivateKey(PrivateKey privateKey) |
void |
setTsaClient(TSAClient tsaClient) |
byte[] |
sign(InputStream content)
SignatureInterface implementation.
|
public CreateSignatureBase(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 final void setPrivateKey(PrivateKey privateKey)
public final void setCertificate(Certificate certificate)
public final void setCertificateChain(Certificate[] certificateChain)
public void setTsaClient(TSAClient tsaClient)
public TSAClient getTsaClient()
public byte[] sign(InputStream content) throws IOException
sign
in interface SignatureInterface
content
- is the content as a (Filter)InputStreamIOException
public void setExternalSigning(boolean externalSigning)
false
, SignatureInterface would be used for signing.
Default: false
externalSigning
- true
if external signing should be performedpublic boolean isExternalSigning()
public int getMDPPermission(PDDocument doc)
doc
- document.public void setMDPPermission(PDDocument doc, PDSignature signature, int accessPermissions)
Copyright © 2002–2017 The Apache Software Foundation. All rights reserved.