如何生成HMAC MD5在Android中? [英] How to Generate HMAC MD5 In Android?
问题描述
我是新在该领域!我有此消息,并重点也是我想用这两它,怎么可能,如果可能的话给出这一信息。给定链路的一些例子或样本code显示整体HMAC MD5功能,我想这样那样的code.手电筒帮我。
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
键= d6fc3a4a06ed55d24fecde188aaa9161
key = d6fc3a4a06ed55d24fecde188aaa9161
链接= http://hash.online-convert.com/md5-generator
推荐答案
看 javax.crypto.Mac中
类。尝试 Mac.getInstance(HMACMD5);
然后使用的init
方法与你的密钥,然后使用更新
和 doFinal
方法,就像你用消息摘要
对象
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.
这篇关于如何生成HMAC MD5在Android中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!