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 |
---|---|
boolean |
isExternalSigning() |
void |
setCertificateChain(Certificate[] certificateChain) |
void |
setExternalSigning(boolean externalSigning)
Set if external signing scenario should be used.
|
void |
setPrivateKey(PrivateKey privateKey) |
void |
setTsaUrl(String tsaUrl) |
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 setCertificateChain(Certificate[] certificateChain)
public void setTsaUrl(String tsaUrl)
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()
Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.