public abstract class SignatureAlgorithm extends Algorithm
sign() in case of a signature computation (the octet stream of the
signature), or by the verify(java.io.InputStream) method in case of a signature creation (a decision wether or not
the specified signature could have been verified).| Modifier and Type | Field and Description |
|---|---|
protected java.io.InputStream |
input_
The input data for the algorithm.
|
protected java.lang.String |
jCEProviderName_
The name of the JCE provider to choose for creating signatures.
|
protected java.security.PrivateKey |
privateKey_
The private key used to compute the signature.
|
| Constructor and Description |
|---|
SignatureAlgorithm() |
| Modifier and Type | Method and Description |
|---|---|
void |
setInput(java.io.InputStream input)
Sets the octet stream data to be processed by the signature algorithm.
|
void |
setJCEProviderName(java.lang.String providerName)
Sets a particular JCE provider to be used for computing the signature.
|
void |
setSignerKey(java.security.PrivateKey signerKey)
Sets the private key to be used by the signature algorithm.
|
abstract void |
setVerifierKey(java.security.Key verifierKey)
Allows IXSIL to set the key to be used for verifying a signature value.
|
abstract java.io.InputStream |
sign()
Computes the signature value for the input previously provided by means of method
setInput(java.io.InputStream). |
abstract boolean |
verifierKeyUnknown()
Tells IXSIL if the algorithm knows about the key to use for verifying a signature, or if this key must
be set by the IXSIL core.
|
abstract boolean |
verify(java.io.InputStream signature)
Verifies the specified signature for the input data previously set with method
setInput(java.io.InputStream). |
getURI, setParameters, setURI, toElementprotected java.io.InputStream input_
protected java.lang.String jCEProviderName_
protected java.security.PrivateKey privateKey_
public abstract java.io.InputStream sign()
throws AlgorithmException
setInput(java.io.InputStream).
The signature algorithm implementation is responsible to know about the key used to compute the
signature value.setInput(java.io.InputStream). This value will NOT
be base64 encoded.AlgorithmException - if computing the signature fails for any reason.public abstract boolean verify(java.io.InputStream signature)
throws AlgorithmException
setInput(java.io.InputStream).
The key necessary to verify the signature can be set either with method setVerifierKey(java.security.Key), or the
signature algorithm implementation knows about this key from any other source.signature - The bytes representing the signature to be verified.true, if the signature is valid, false otherwise.AlgorithmException - if the validity of the signature cannot be checked for any reason.public abstract void setVerifierKey(java.security.Key verifierKey)
throws AlgorithmException
verifierKey - The key to be used for signature verification. Must obviously fit for the
implemented algorithm.AlgorithmException - if the key does not fit for the implemented algorithm.public abstract boolean verifierKeyUnknown()
true if the signature algorithm does not know about the verification key.public void setInput(java.io.InputStream input)
input - The data to be processed by the signature algorithm. Must not be null.public void setJCEProviderName(java.lang.String providerName)
throws AlgorithmException
providerName - The name of the JCE provider. A provider with this name must currently be
installed. May be null to reset a previously chosen provider.AlgorithmException - if a provider with the specified name is currently not installed.public void setSignerKey(java.security.PrivateKey signerKey)
throws AlgorithmException
signerKey - The private key to be used by the signature algorithm.AlgorithmException