public abstract class ServiceSignature
extends java.lang.Object
| Constructor and Description |
|---|
ServiceSignature() |
| Modifier and Type | Method and Description |
|---|---|
abstract byte[] |
computeHash(byte[] key,
byte[] data)
Computes the hash of the data by the given key.
|
abstract java.lang.String |
computeSignature(java.lang.String key,
java.lang.String data)
Computes the signature of the data by the given key.
|
static ServiceSignature |
create()
Creates the default
ServiceSignature instance which is
HmacSHA1Signature. |
static ServiceSignature |
create(java.lang.String algorithm)
Creates the
ServiceSignature instance by the algorithm |
abstract java.lang.String |
getAlgorithm()
Gets the algorithm of signature.
|
abstract java.lang.String |
getVersion()
Gets the algorithm version.
|
protected byte[] |
sign(byte[] key,
byte[] data,
javax.crypto.Mac macInstance,
java.lang.Object lock,
java.lang.String algorithm) |
public abstract java.lang.String getAlgorithm()
public abstract java.lang.String getVersion()
public abstract java.lang.String computeSignature(java.lang.String key,
java.lang.String data)
key - The key for the signature.data - The data to compute the signature on.public abstract byte[] computeHash(byte[] key,
byte[] data)
key - The key for the signature.data - The data to compute the hash on.public static ServiceSignature create()
ServiceSignature instance which is
HmacSHA1Signature.ServiceSignature instancepublic static ServiceSignature create(java.lang.String algorithm)
ServiceSignature instance by the algorithmServiceSignature instanceprotected byte[] sign(byte[] key,
byte[] data,
javax.crypto.Mac macInstance,
java.lang.Object lock,
java.lang.String algorithm)