如何在 Android 中生成 HMAC MD5? [英] How to Generate HMAC MD5 In Android?
问题描述
我是这个领域的新手!我有这个消息和密钥我也想要 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
方法与您的密钥一起使用,然后使用 update
和 doFinal
方法就像使用 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屋!