简体   繁体   English

如何将BigInteger传递给签名函数

[英]How to pass BigInteger to a Signature function

Here I'm implementing digital signature using RSA. 在这里,我正在使用RSA实现数字签名。 I read a plain text from a file and get MD5 ie instance of a MessageDigest of the plain text and converting that plain text to BigInteger here this bigInteger should be signed. 我从文件中读取纯文本,然后获取MD5,即纯文本的MessageDigest实例,并将该纯文本转换为BigInteger,此处应对此bigInteger进行签名。

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. //这里我不知道如何将BigInteger传递给Signature函数。

Could someone please help me with it. 有人可以帮我吗。

You don't. 你不知道 You get the bytes out of the BigInteger and you pass those. 您从BigInteger中获取字节,然后将其传递。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM