xml-signature

Difference between signing a XML message using dsig:Signature and TLS Client Certificate

拈花ヽ惹草 提交于 2019-11-30 21:11:15
问题 I realise this question may be a bit vague or I may be using incorrect terminology, that is because I am trying to get to grips with this stuff :). I have a requirement to implement digital signing of a XML message by using a dsig:Signature section. I think I understand this process; I will use a private key to sign it which will guarantee to the recipient that it was me who sent the message and that no one has tampered with it. Am I right that this is different from implementing TLS Client

XML Canonicalization algorithm gives two difference results when called directly than when called as part of an xml digital signature?

落花浮王杯 提交于 2019-11-30 19:39:57
I'm getting two different hashes of the same xml document when I directly canonicalize some xml than when I perform a digital signature on it which also performs the same canonicalization algoririth on the xml before hashing it? I worked out that the digital signature canonicalization includes the new line characters '\n' and spacing characters when canonicalizing and the direct algorithm does not. Including the new line characters + spaces is not in the canonicalization specification though? I'm specifically looking at this version http://www.w3.org/TR/2001/REC-xml-c14n-20010315 Does anyone

Convert XML Dsig format to DER ASN.1 public key

半世苍凉 提交于 2019-11-30 16:37:48
I am working on an iPhone app that retrieves an RSA public key from an ASP.NET web service in the form: <RSAKeyValue> <Modulus>qdd0paiiBJ+xYaN4TKDdbEzrJJw9xlbRAltb5OPdegjLoW60yOjL/sni52WVsGC9QxpNitZR33dnUscmI0cTJoxkXypPjbD94UpH+p4el2tuKBypHlE7bERApuUp55y8BiRkbQNFH8smZFWDwtIc/PsJryeGf8fAryel8c5V3PU=</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> I need to then convert this response into an NSData * of the appropriate format (from some intense Googling, most likely 'ASN.1 DER' binary format. I've got code in place to convert both parts from their Base64 representations to the original binary

Digitally Sign Parts of a XML document

徘徊边缘 提交于 2019-11-30 16:25:56
问题 I have an XML document having structure similar to the following <envelop> <header>blaa</header> <message>blaa blaa</message> <footer></footer> </envelop> I want to digitally sign the header and message elements and add the signature to the footer element. How can I sign the elements and then later verify the signature (using .net c#) ? 回答1: You should be able to add an XPath-Transform to the Signature. It should look something like this: <Transform Algorithm="http://www.w3.org/TR/1999/REC

Digitally Sign Parts of a XML document

倾然丶 夕夏残阳落幕 提交于 2019-11-30 16:08:53
I have an XML document having structure similar to the following <envelop> <header>blaa</header> <message>blaa blaa</message> <footer></footer> </envelop> I want to digitally sign the header and message elements and add the signature to the footer element. How can I sign the elements and then later verify the signature (using .net c#) ? You should be able to add an XPath-Transform to the Signature. It should look something like this: <Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"> <XPath xmlns:dsig="&dsig;"> ... </XPath> </Transform> I am not fluent in XPath, but it should

“Manifest XML signature is not valid”

大城市里の小女人 提交于 2019-11-30 12:08:01
OS: Windows 7 64 bit using Visual Studio Pro 2012 with .NET 4.5 installed. I used the Publish option within Visual Studios and ensured that I had clicked the Sign the clickOnce manifest and Sign the Assembly. It will still not run on another computer and says I do not have a valid XML signature. I have pasted the error message below. I have also read: How to move a ClickOnce deployment package , Do I have to sign my ClickOnce manifest? . VS2012 .NET 4.0 Clickonce VSTO CryptographicException: SignatureDescription could not be created for the signature algorithm supplied and several others. I

XSLT transform in xmlSignature java?

廉价感情. 提交于 2019-11-30 09:19:31
I have a XML document.I am signing a part of document using xmlsignature. Before finding digest, I want to apply XSLT transform. According to what I read, XSLT converts an XML document to another format(can be XML also). Now I am confused that, where will be the transformed new document is avilable? How to retrieve the value from this newly created document if I want to show it to user? My XML Document <r1> <user>asd</user> <person>ghi</person> </r1> Code for Transformation Transform t=fac.newTransform(Transform.XPATH,new XPathFilterParameterSpec("/r1/user")); According to xpath transformation

Java XML DSig and XPath

南笙酒味 提交于 2019-11-30 07:55:29
I'm signing part of an XML document using the Java XML DSig api. I'm trying to understand how it is arriving at the Digest value. My document is: <?xml version=\"1.0\" encoding=\"UTF-8\"?><PurchaseOrder><foo>bar</foo></PurchaseOrder> My xpath expression is: PurchaseOrder/foo/text() What I attempt to do is: Call the Java DSIG library and view the value of the generated digest. Use the MessageDigest (SHA-1) class to digest the value "bar". Verify that the digests from 1 and 2 match. When I do this, 1 and 2 produce different digest values. Either I'm doing something totally wrong with my DSIG

Java equivalent of C# XML signing method

给你一囗甜甜゛ 提交于 2019-11-30 07:34:24
I have written the following .NET Framework 3.5 C# method which takes the location of an XML document and an object representation of an X509 digital certificate (with a private key) and returns the XML document as an object with the XML Signature (XMLDsig) embedded as first child element of the root. The thing is that I direly need to be able to do the exact same procedure with Java SE 6, but I have not written any Java in ages and have no clue where to begin. Can anyone provide the equivalent method in Java code that produces the exact same XML output? private static XmlDocument

Convert XML Dsig format to DER ASN.1 public key

徘徊边缘 提交于 2019-11-29 23:48:56
问题 I am working on an iPhone app that retrieves an RSA public key from an ASP.NET web service in the form: <RSAKeyValue> <Modulus>qdd0paiiBJ+xYaN4TKDdbEzrJJw9xlbRAltb5OPdegjLoW60yOjL/sni52WVsGC9QxpNitZR33dnUscmI0cTJoxkXypPjbD94UpH+p4el2tuKBypHlE7bERApuUp55y8BiRkbQNFH8smZFWDwtIc/PsJryeGf8fAryel8c5V3PU=</Modulus> <Exponent>AQAB</Exponent> </RSAKeyValue> I need to then convert this response into an NSData * of the appropriate format (from some intense Googling, most likely 'ASN.1 DER' binary format