如何在 Android 中生成 HMAC MD5? [英] How to Generate HMAC MD5 In Android?

查看:14
本文介绍了如何在 Android 中生成 HMAC MD5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这个领域的新手!我有这个消息和密钥我也想要 HMAC MD5 使用这两个所以如果可能的话怎么可能然后给出一些例子或示例代码.给定的链接显示我想要的整体功能这样的代码.请帮助我.

I am new in this Field!I have this Message and Key also i want HMAC MD5 using this two so how it is possible if possible then give some example or sample code of this.The Given link display the overall functionality i want such kind of code.Please help me.

Messgae = POSTuserMon,28Jun201010:18:33GMT7FF4471B-13C0-5A9F-BB7B-7309F1AB7F08

Messgae = POSTuserMon,28Jun201010:18:33GMT7FF4471B-13C0-5A9F-BB7B-7309F1AB7F08

key = d6fc3a4a06ed55d24fecde188aaa9161

key = d6fc3a4a06ed55d24fecde188aaa9161

链接 = http://hash.online-convert.com/md5-generator

推荐答案

看看 javax.crypto.Mac 类.尝试 Mac.getInstance("HmacMD5"); 然后将 init 方法与您的密钥一起使用,然后使用 updatedoFinal 方法就像使用 MessageDigest 对象一样.

Look at the javax.crypto.Mac class. Try Mac.getInstance("HmacMD5"); and then use the init method with your key and then use the update and doFinal methods just as you would with a MessageDigest object.

这篇关于如何在 Android 中生成 HMAC MD5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆