How to pass BigInteger to a Signature function

这一生的挚爱 提交于 2019-12-10 00:30:55

问题


Here I'm implementing digital signature using RSA. I read a plain text from a file and get MD5 i.e instance of a MessageDigest of the plain text and converting that plain text to BigInteger here this bigInteger should be signed.

MessageDigest m1 = MessageDigest.getInstance("MD5");

m1.update(bFile);

byte [] digest1 = m1.digest();

for(int i=0; i < digest1.length ; i++){
    System.out.println("b["+i+"]="+digest1[i]);
}

BigInteger bi = new BigInteger(digest1);

//here I dont know how to pass BigInteger to Signature function.

Could someone please help me with it.


回答1:


You don't. You get the bytes out of the BigInteger and you pass those.



来源:https://stackoverflow.com/questions/29066294/how-to-pass-biginteger-to-a-signature-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!