472,989 Members | 3,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

SignedXML throws error

When I try to used the CheckSignature Method of SignedXML I get the following
error.

"Unknown transform has been encountered. at
System.Security.Cryptography.Xml.Reference.LoadXml (XmlElement value)\r\n at
System.Security.Cryptography.Xml.SignedInfo.LoadXm l(XmlElement value)\r\n
at System.Security.Cryptography.Xml.Signature.LoadXml (XmlElement value)\r\n
at System.Security.Cryptography.Xml.SignedXml.LoadXml (XmlElement value)\r\n
at SAML.Form1.button2_Click(Object sender, EventArgs e) in
d:\\omtest\\saml\\form1.cs:line 295" string

Any ideas what might be going wrong, I have checked the code a couple of
time & am pretty sure the LoadXML & assigning of the key is fine, somewhere I
read that it has to do wiht the machine config file, I need some more
information regarding what needs to change out there.

Thanks,
--
Nikhil Sarathi
Nov 12 '05 #1
2 4843
"Nikhil" <Ni****@discussions.microsoft.com> wrote in message news:B1**********************************@microsof t.com...
When I try to used the CheckSignature Method of SignedXML I get the following
error.

"Unknown transform has been encountered. at
System.Security.Cryptography.Xml.Reference.LoadXml (XmlElement value)\r\n at
System.Security.Cryptography.Xml.SignedInfo.LoadXm l(XmlElement value)\r\n : : I need some more information regarding what needs to change out there.
Undoubtedly, you have one or more <ds:Reference> elements containing a
<ds:Transform> with an invalid Algorithm. For example, there are places in
your <ds:SignatureInfo> like,

<ds:Reference>
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1">
<!-- . . . -->

Where the URI (and this could be as simple as SHA1, or SHA{keyLength} so
sometimes you may see SHA512, etc.) specified for Algorithm is not being
recognized.

See the following URL for a list of the well-known XML Digital Signature
algorithm URIs that can appear as the value of the Algorithm attribute,

http://www.w3.org/TR/xmldsig-core/#sec-AlgID

You can fix this by using one of the well-known algorithm URIs, double-check
that there are no typos or trailing backslashes on that Algorithm ID value.
I read that it has to do wiht the machine config file,


You can add or override the classes that provide the hash functions specifying
class names in the <cryptographicSettings> section of machine.config,

http://msdn.microsoft.com/library/en...ingsschema.asp

but you must deploy the implementation on all machines that need to handle
(verify or produce) these signatures using your custom Algorithm.

It's more likely the answer to your problem is the former (typo, malformed
algorithm identifier), rather than something that would require you to modify
the machine.config.
Derek Harmon
Nov 12 '05 #2
Hey Derek,
Thanks for your response the problem seems to be with the
Transform, in the xml file I have they use exclusive canonicalization and I
dont think .NET 1.1 supports it, do you know of any way to handle this
problem.
"Derek Harmon" wrote:
"Nikhil" <Ni****@discussions.microsoft.com> wrote in message news:B1**********************************@microsof t.com...
When I try to used the CheckSignature Method of SignedXML I get the following
error.

"Unknown transform has been encountered. at
System.Security.Cryptography.Xml.Reference.LoadXml (XmlElement value)\r\n at
System.Security.Cryptography.Xml.SignedInfo.LoadXm l(XmlElement value)\r\n

: :
I need some more information regarding what needs to change out there.


Undoubtedly, you have one or more <ds:Reference> elements containing a
<ds:Transform> with an invalid Algorithm. For example, there are places in
your <ds:SignatureInfo> like,

<ds:Reference>
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1">
<!-- . . . -->

Where the URI (and this could be as simple as SHA1, or SHA{keyLength} so
sometimes you may see SHA512, etc.) specified for Algorithm is not being
recognized.

See the following URL for a list of the well-known XML Digital Signature
algorithm URIs that can appear as the value of the Algorithm attribute,

http://www.w3.org/TR/xmldsig-core/#sec-AlgID

You can fix this by using one of the well-known algorithm URIs, double-check
that there are no typos or trailing backslashes on that Algorithm ID value.
I read that it has to do wiht the machine config file,


You can add or override the classes that provide the hash functions specifying
class names in the <cryptographicSettings> section of machine.config,

http://msdn.microsoft.com/library/en...ingsschema.asp

but you must deploy the implementation on all machines that need to handle
(verify or produce) these signatures using your custom Algorithm.

It's more likely the answer to your problem is the former (typo, malformed
algorithm identifier), rather than something that would require you to modify
the machine.config.
Derek Harmon

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Raghu | last post by:
I am using SignedXml class to sign and verify soap xml documents. We are not using WSE at this point. When I sign a soap document and send it to my trading partner, they can verify the document...
0
by: pak76 | last post by:
Class SignedXml is used to produce/verify signature over XML document. One of its methods, function GetIdElement, is used to select Xml elements for signature and verification and consist following...
0
by: ChrisA | last post by:
I'm using Michael Gallants DecodeCertKey example to get the public key from an X509 certificate. I then create an RSAServiceProvider and try to use it to CheckSignature() on the signed XML file....
4
by: Karol | last post by:
Hello, I'm trying to create signed XML document with SignedXml class. As a SigningKey I'd like to use key pair obtained from user certificate stored in current user certificate store. I'm using...
2
by: William Stacey [MVP] | last post by:
Given the following, how do I get the plain xml without the security elements (i.e. the original xml before the security was added) in the VerifyXML() method. TIA. using System; using...
0
by: Senshodan | last post by:
Hi all, I'm trying to use the SignedXML class in order to create a XMLDSIG signature using a certificate stored in a smartcard. For that purpose I find out the data of the certificate context (...
2
by: Rune Nergard | last post by:
I have tried to use the System.Security.Cryptography.Xml.SignedXml class to sign an Xml message with Xml-DSIG and using an Enveloped signature type and the sha1RSA algorithm. Everything works fine...
1
by: Peter Ravnholt | last post by:
Hello all, It seems that digitally signing XML documents using the SignedXml class has a bug - or at least a behavior I cannot explain. The problem occurs when I sign XML documents containing...
0
by: Iguana | last post by:
Hi! Im creating project in c# .net2.0, to sign and verify documens us xmldsig format. My problem is how to use prefix "ds" instead of: xmlns="http://www.w3.org/2000/09/xmldsig#" in SignedInfo,...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.