BouncyCastle.dll 在 C# 中使用 DH 错误?
var dhparams = new DHParameters(
new BigInteger("E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F"),
new BigInteger("05"));
var genparams = new DHKeyGenerationParameters(new SecureRandom(), dhparams);
var generator = new DHKeyPairGenerator();
generator.Init(genparams);
var pair = generator.GenerateKeyPair();
var pubkey = (DHPublicKeyParameters)pair.Public;
//so public key pubkey.Y
我收到错误
mscorlib.dll 中发生“System.FormatException”类型的未处理异常
堆栈在 var dhparams = new DHParameters(....`
我不知道出了什么问题,这是我第一次,而且 pubkey.Y 是公钥对吗?谢谢
var dhparams = new DHParameters(
new BigInteger("E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F"),
new BigInteger("05"));
var genparams = new DHKeyGenerationParameters(new SecureRandom(), dhparams);
var generator = new DHKeyPairGenerator();
generator.Init(genparams);
var pair = generator.GenerateKeyPair();
var pubkey = (DHPublicKeyParameters)pair.Public;
//so public key pubkey.Y
am geting error
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
var dhparams = new DHParameters(....`
stack in
I don't know what's wrong it's my 1st time though , also pubkey.Y is the public key right? thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与:
类型为“System”的未处理异常mscorlib.dll 中发生“.FormatException”
Same as:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll