實現:html
1.c#將xml報文作數字簽名發送到java服務,java服務成功驗籤。java
2.c#服務對收到java服務推送的xml報文成功驗籤。git
前提:算法
1.java服務要求c#
遇到問題:api
1.Java和.net 以前 RSA 私鑰祕鑰格式問題。加密
2.framework4.0 SignatureDescription could not be created for the signature algorithm supplied. .net
沒法爲所提供的簽名算法建立SignatureDescription。——資料6 第二個連接,關鍵在:在全局文件中,對加密配置(CryptoConfig)添加算法 RsaPkcs1Sha256SignatureDescriptionxml
3.htm
資料:
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