public class Signer extends Object
构造器和说明 |
---|
Signer(byte[] secret)
Creates a Signer instance using the specified secret.
|
限定符和类型 | 方法和说明 |
---|---|
protected String |
computeSignature(String str)
Returns then signature of a string.
|
String |
sign(String str)
Returns a signed string.
|
String |
verifyAndExtract(String signedStr)
Verifies a signed string and extracts the original string.
|
public Signer(byte[] secret)
secret
- secret to use for creating the digest.public String sign(String str)
str
- string to sign.public String verifyAndExtract(String signedStr) throws SignerException
signedStr
- the signed string to verify and extract.SignerException
- thrown if the given string is not a signed string or if the signature is invalid.Copyright © 2009 The Apache Software Foundation