public abstract class AbstractSignature extends Object implements Signature
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSignature(String algorithm) |
| Modifier and Type | Method and Description |
|---|---|
protected Pair<String,byte[]> |
extractEncodedSignature(byte[] sig)
Makes an attempt to detect if the signature is encoded or pure data
|
String |
getAlgorithm() |
void |
initSigner(PrivateKey key) |
void |
initVerifier(PublicKey key) |
String |
toString() |
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
|
protected Signature signature
protected AbstractSignature(String algorithm)
public final String getAlgorithm()
getAlgorithm in interface Signaturepublic void initVerifier(PublicKey key) throws Exception
initVerifier in interface Signaturekey - The PublicKey to be used for verifying signaturesException - If failed to initializepublic void initSigner(PrivateKey key) throws Exception
initSigner in interface Signaturekey - The PrivateKey to be used for signingException - If failed to initializepublic void update(byte[] hash)
throws Exception
Signatureupdate in interface Signaturehash - The hash data bufferException - If failed to updateSignature.update(byte[], int, int)public void update(byte[] hash,
int off,
int len)
throws Exception
Signatureprotected Pair<String,byte[]> extractEncodedSignature(byte[] sig)
sig - The original signaturePair where first value is the key type and second
value is the data - null if not encodedCopyright © 2008–2015 The Apache Software Foundation. All rights reserved.