public abstract class ServiceSignature extends Object
| 构造器和说明 |
|---|
ServiceSignature() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract byte[] |
computeHash(byte[] key,
byte[] data)
Computes the hash of the data by the given key.
|
abstract String |
computeSignature(String key,
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(String algorithm)
Creates the
ServiceSignature instance by the algorithm |
abstract String |
getAlgorithm()
Gets the algorithm of signature.
|
abstract String |
getVersion()
Gets the algorithm version.
|
protected byte[] |
sign(byte[] key,
byte[] data,
Mac macInstance,
Object lock,
String algorithm) |
public abstract String getAlgorithm()
public abstract String getVersion()
public abstract String computeSignature(String key, 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(String algorithm)
ServiceSignature instance by the algorithmServiceSignature instanceCopyright © 2022. All Rights Reserved.