从ECDSA签名签名c#提取R和S
我正在使用.NET 5中的signedxml类用于使用ECDA生成签名 我需要R和S的价值,但我无法提取它,另一个问题是 签名长度。我的签名总是64个字节,但ECDSA签名长度为71 而且我不知道为什么这段时间会改变。请帮助我提取R和S
I'm using Signedxml class in .net 5 to generate signature using ECDSA
and I need the value of r and s but I can not extract it and another problem is
signature length . My signature always 64 bytes but ECDSA signature length is 71
and I do not know why this length change . Please help me extract r and s
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将ECDA签名从ASN.1/der转换为p1363(r | s)格式时,必须考虑以下内容:
使用
asnreader
class classclass
自从.NET 5。对于完整性以来,可以 类实现。
org.bouncycastle.asn1
名称空间)。为此,dertop1363()
中的前三行必须由以下方式代替:When converting the ECDSA signature from ASN.1/DER to P1363 (r|s) format, the following must be taken into account:
Possible implementation with .NET 5+ using the
AsnReader
class:AsnReader
is available since .NET 5.For completeness: In other .NET versions BouncyCastle can be applied (using classes from the
Org.BouncyCastle.Asn1
namespace). For this, the first three lines inDERtoP1363()
must by replaced by: