public interface Signature
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm() |
void |
initSigner(PrivateKey key) |
void |
initVerifier(PublicKey key) |
byte[] |
sign()
Compute the signature
|
void |
update(byte[] hash)
Update the computed signature with the given data
|
void |
update(byte[] hash,
int off,
int len)
Update the computed signature with the given data
|
boolean |
verify(byte[] sig)
Verify against the given signature
|
String getAlgorithm()
void initSigner(PrivateKey key) throws Exception
key
- The PrivateKey
to be used for signingException
- If failed to initializevoid update(byte[] hash) throws Exception
hash
- The hash data bufferException
- If failed to updateupdate(byte[], int, int)
void update(byte[] hash, int off, int len) throws Exception
hash
- The hash data bufferoff
- Offset of hash data in bufferlen
- Length of hash dataException
- If failed to updateboolean verify(byte[] sig) throws Exception
sig
- The signed datatrue
if signature is validException
- If failed to extract signed data for validationCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.