Updated on 2025-11-27 GMT+08:00

ISV Server Signing a Response Message Body

Code Invocation

/**
* Demo of generating a signature of an HTTP response body
* @param key --Access key obtained on the Seller Console. Log in to the Seller Console to view the access key.
* @param body --HTTP response message body
* @return --Encryption result
* @throws InvalidKeyException
* @throws NoSuchAlgorithmException
* @throws IllegalStateException
* @throws UnsupportedEncodingException
*/
public static String generateResponseBodySignature(String key, String body)
throws InvalidKeyException, NoSuchAlgorithmException,
IllegalStateException, UnsupportedEncodingException
{
return base_64(hmacSHA256(key, body));
}