My Friend told me to use "HMACSHA256" algo and i have used the below code :
SecretKey signingKey = new SecretKeySpec("123".getBytes(), "HMACSHA256");
Mac mac = Mac.getInstance("HMACSHA256");
mac.init(signingKey);
byte[] digest = mac.doFinal("ABCDEF".getBytes());
System.out.println("HMA : "+digest.length);
Just wanted to know that :
1) is the above implementation looks standard "HMACSHA256" ?
2) Output (digest) is coming as 256 bits or 16 bytes.Is this correct.
If we are using HMACSHA256 algo, how many bytes we need to expect to come as an output.