如何将BigInteger传递给签名函数 [英] How to pass BigInteger to a Signature function

查看:180
本文介绍了如何将BigInteger传递给签名函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我使用RSA实现数字签名。我从文件中读取纯文本并获取MD5即纯文本的MessageDigest实例,并将该纯文本转换为BigInteger,此处应签署此bigInteger。

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);

//这里我不知道如何将BigInteger传递给Signature函数。

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

有人可以帮助我吗。

推荐答案

你没有。你从BigInteger中获取了字节,然后传递了这些字节。

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

这篇关于如何将BigInteger传递给签名函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆