Interface SignatureUtil
-
public interface SignatureUtilSignatureUtil interface.- Since:
- 1.0.0
- Author:
- Srinivasan, Urvil
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SignatureResponsesign(String data)booleanvalidate(String signature, String data, String timestamp)Validate with public key.booleanvalidateWithPublicKey(String signature, String data, String publickey)Validate with public key.
-
-
-
Method Detail
-
sign
SignatureResponse sign(String data)
-
validateWithPublicKey
boolean validateWithPublicKey(String signature, String data, String publickey) throws InvalidKeySpecException, NoSuchAlgorithmException
Validate with public key.- Parameters:
signature- the response signaturedata- the response bodypublickey- the base64 encoded public key string- Returns:
- true, if successful
- Throws:
InvalidKeySpecException- the invalid key spec exceptionNoSuchAlgorithmException- the no such algorithm exception
-
validate
boolean validate(String signature, String data, String timestamp)
Validate with public key.- Parameters:
signature- the response signaturedata- the response bodytimestamp- the sign timestamp- Returns:
- true, if successful
- Throws:
InvalidKeySpecException- the invalid key spec exceptionNoSuchAlgorithmException- the no such algorithm exception
-
-