javax.crypto.Mac

Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
 SecretKeySpec secretKeySpec = new SecretKeySpec(sharedSecret.getBytes("UTF-8"), "HmacSHA256");
sha256_HMAC.init(secretKeySpec);
byte[] calculatedSignatureBytes = sha256_HMAC.doFinal(signedString.getBytes("UTF-8"));
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s