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 Signature
public void initVerifier(PublicKey key) throws Exception
initVerifier
in interface Signature
key
- The PublicKey
to be used for verifying signaturesException
- If failed to initializepublic void initSigner(PrivateKey key) throws Exception
initSigner
in interface Signature
key
- The PrivateKey
to be used for signingException
- If failed to initializepublic void update(byte[] hash) throws Exception
Signature
update
in interface Signature
hash
- The hash data bufferException
- If failed to updateSignature.update(byte[], int, int)
public void update(byte[] hash, int off, int len) throws Exception
Signature
protected 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–2016 The Apache Software Foundation. All rights reserved.