@License public abstract class Signer extends CryptoService
| Modifier and Type | Field and Description |
|---|---|
protected String |
alias
The alias identifying the certificate to be used for signing.
|
protected boolean |
encapsulate
Whether the signer should encapsulate data along with the signature.
|
protected KeyRing |
keyring
The key ring (as a wrapper and helper to access the key store).
|
protected Provider |
provider
The security provider.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Signer(String alias,
KeyRing keyring,
Provider provider)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEncapsulateData()
Returns whether the data is going to be encapsulated along with the signature.
|
void |
setEncapsulateData(boolean encapsulate)
Sets whether the data should be encapsulated along with the signature,
or the signature is detached.
|
abstract byte[] |
sign(byte[] data)
Signs the given set of data.
|
abstract void |
sign(InputStream input,
OutputStream output)
Signs the given set of data; the caller must make sure both input and
output stream are properly closed once the processing is complete.
|
protected String alias
protected KeyRing keyring
protected Provider provider
protected boolean encapsulate
protected Signer(String alias, KeyRing keyring, Provider provider) throws CryptoException
alias - the alias of the certificate to be used for signing.keyring - the key ring, as a wrapper and helper to acces the key store.provider - the security provider supporting and exposing the key store capabilities.CryptoException - if any of the input parameters is null.public void setEncapsulateData(boolean encapsulate)
encapsulate - whether the data is encapsulated along with the signature.public boolean isEncapsulateData()
public abstract byte[] sign(byte[] data)
throws CryptoException
data - the data to be signed.CryptoExceptionpublic abstract void sign(InputStream input, OutputStream output) throws CryptoException
input - the stream providing the data to be signed, as an input stream.output - a stream to write to.CryptoExceptionCopyright © 2012-2014 Andrea Funtò. See here for terms and conditions.