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.
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