java xml 加签_【签名加解密】c# 对XML进行数字签名并且让java验签成功

实现:

1.c#将xml报文做数字签名发送到java服务,java服务成功验签。

2.c#服务对收到java服务推送的xml报文成功验签。

前提:

1.java服务要求

遇到问题:

1.Java和.net 之前 RSA 私钥秘钥格式问题。

2.framework4.0 SignatureDescription could not be created for the signature algorithm supplied.

无法为所提供的签名算法创建SignatureDescription。——资料6 第二个链接,关键在:在全局文件中,对加密配置(CryptoConfig)添加算法 RsaPkcs1Sha256SignatureDescription

3.

资料:

1.msdn:xml签名:https://docs.microsoft.com/zh-cn/dotnet/standard/security/how-to-sign-xml-documents-with-digital-signatures

2.msdn:xml验签:https://docs.microsoft.com/zh-cn/dotnet/standard/security/how-to-verify-the-digital-signatures-of-xml-documents

3.csdn讨论帖:https://bbs.csdn.net/topics/392005202

4.C#下解析、生成JAVA的RSA密钥、公钥:https://blog.csdn.net/starfd/article/details/51838589

5.微软对xml加签验签的举例:https://docs.microsoft.com/zh-cn/dotnet/api/system.security.cryptography.xml.signedxml?view=netframework-4.7.2

6.stack overflow对xml sha256签名的讨论帖:

1). https://stackoverflow.com/questions/17258800/c-sharp-support-for-rsa-sha-256-signing-for-individual-xml-elements

2). http://www.voidcn.com/article/p-ezohxnnk-bty.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值