Android Utililty Methods HMac Hash

List of utility methods to do HMac Hash

Description

The list of methods to do HMac Hash are organized into topic(s).

Method

voidderivePKCS5S2Helper(Mac hMac, byte[] P, byte[] S, int c, byte[] iBuf, byte[] out, int outOff)
derive PKCSS Helper
byte[] state = new byte[hMac.getMacLength()];
SecretKeySpec param = new SecretKeySpec(P, "SHA1");
hMac.init(param);
if (S != null) {
    hMac.update(S, 0, S.length);
hMac.update(iBuf, 0, iBuf.length);
hMac.doFinal(state, 0);
...
StringgetHmac(String[] args, String key)
get Hmac
if (args == null || args.length == 0) {
    return (null);
StringBuffer str = new StringBuffer();
for (int i = 0; i < args.length; i++) {
    str.append(args[i]);
return (hmacSign(str.toString(), key));
...
StringhmacSign(String aValue, String aKey)
hmac Sign
byte k_ipad[] = new byte[64];
byte k_opad[] = new byte[64];
byte keyb[];
byte value[];
try {
    keyb = aKey.getBytes(encodingCharset);
    value = aValue.getBytes(encodingCharset);
} catch (UnsupportedEncodingException e) {
...