如何修复DecodeRSAPriveteKey的错误错误长度错误? [英] How to fix error Bad length error for DecodeRSAPriveteKey?

查看:85
本文介绍了如何修复DecodeRSAPriveteKey的错误错误长度错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:



  1. Bad长度

  2. 对象引用未设置为对象的实例。

我正在使用此代码:

我将不胜感激任何指导,建议或帮助我解决这个问题的帮助

I would appreciate any guidance, advice, or assistance in helping me get this resolved

推荐答案

嗨Zarini,

Hi Zarini,

感谢您在此发帖。

>> 对象引用未设置为对象的实例。

请确保您使用的参数不为空。您可以
使用  String.IsNullOrWhiteSpace方法(字符串)
 检查下面代码的参数。

Please make sure that the parameter you used is not null. You could use String.IsNullOrWhiteSpace Method (String) to check the parameter of the code below.

 byte[] signatureBytes = rsaCsp.SignData(dataBytes, "SHA256"); <-----error here: Object reference not set to an instance of an object.

> ;> 错误的长度

您使用try catch来捕获异常,但是您没有提供哪一行尝试获取例外。你能提供获得例外的代码行吗?你能否提供Bad Length的详细信息?

You use try catch to catch the exception, but you did not provide which line in try you get the exception. Could you provide which line of the code you get the exception? And could you provide the details of Bad Length?

最好的问候,

Wendy


这篇关于如何修复DecodeRSAPriveteKey的错误错误长度错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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