EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Signing Soap Message

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#27386
Posted: 11/26/2013 05:25:29
by marco hagen (Standard support level)
Joined: 11/09/2013
Posts: 33

Sorry one more question please:

How to change the TElXMLWSSSignatureHandler Canonicalistation Algorithm

Currently:
Code
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>

But needs to be:
Code
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>


Edit: void handler_OnPrepareSignature Signer.CanonicalizationMethod = 1; does the trick but not sure if that generates a valid signature.

Thanks,
Marco
#27387
Posted: 11/26/2013 06:49:29
by Dmytro Bogatskyy (EldoS Corp.)

Hello,

Quote
How to change the TElXMLWSSSignatureHandler Canonicalistation Algorithm

The Web Services Security (WSS) standard says that exclusive canonicalization method should be used for the signature. In your case it is inclusive canonicalization. And so there is no additional property to change it.
Quote
void handler_OnPrepareSignature Signer.CanonicalizationMethod = 1; does the trick but not sure if that generates a valid signature.

Yes, it's a correct way to change canonicalization method for the signature. (it's better to use constant SBXMLDefs.Unit.xcmCanon not its value)
#27410
Posted: 11/26/2013 16:56:32
by marco hagen (Standard support level)
Joined: 11/09/2013
Posts: 33

Hi Dmytro,

Almost there but found the Digest becoming incorrect (compared to SoapUI which does work with the bank's server) when I change the transform canonicalization:

Code
trans.CanonicalizationMethod = SBXMLDefs.Unit.xcmCanon;
//trans.InclusiveNamespacesPrefixList = ("cor mod");
trans.TransformAlgorithmURI = "http://www.w3.org/2001/10/xml-exc-c14n#";
Ref.TransformChain.Add(trans);
refs.Add(Ref);

Correct digest:
<ds:DigestValue>A/alhyz32g48MRKVeF9jzaIg3+c=</ds:DigestValue>


Code
trans.CanonicalizationMethod = SBXMLDefs.Unit.xcmExclCanon;
trans.InclusiveNamespacesPrefixList = ("cor mod");
trans.TransformAlgorithmURI = "http://www.w3.org/2001/10/xml-exc-c14n#";
Ref.TransformChain.Add(trans);
refs.Add(Ref);

Incorrect digest:
<ds:DigestValue>c6iwZ4M7SpDk5b/kRHTOQJfFbKM=</ds:DigestValue>


But with xcmCanon InclusiveNamespace is not allowed..

I'm puzzling for a day with this now. Your help is really appreciated...

Thanks,
Marco
#27412
Posted: 11/26/2013 17:29:03
by Dmytro Bogatskyy (EldoS Corp.)

Could you please check if this issue occurs with the latest version. There was a fix in processing InclusiveNamespacesPrefixList for specific case.
If it will not help, please attach both xml documents here or to helpdesk.
#27428
Posted: 11/27/2013 03:21:04
by marco hagen (Standard support level)
Joined: 11/09/2013
Posts: 33

Yes!! in 242 it seems to be working (I was on 241).

Code
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces PrefixList="cor mod" xmlns="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>A/alhyz32g48MRKVeF9jzaIg3+c=</ds:DigestValue>


Digest is now correct with InclusiveNamespaces.

Have ran only a small test, will test more tonight and post results.

Thanks for your support !!
Marco
#27454
Posted: 11/27/2013 15:23:36
by marco hagen (Standard support level)
Joined: 11/09/2013
Posts: 33

I can confirm 242 version does work fine !!!

Now the me 'feeling stupid question' how can the following line be converted to vb.net?

Code
TElXMLC14NTransform TRANS = handler.References.get_Reference(0).TransformChain.get_Transforms(0) as TElXMLC14NTransform;


Looks like the get_Reference is not implemented or ???

Thanks again,
Marco

FYI: I have never seen this fast and professional support like this on a library with trial license before, and seeing the product doing the job (but in wrong language :-) I can inform you a license will be acquired next week (when our CTO is back).
#27456
Posted: 11/27/2013 15:55:16
by Dmytro Bogatskyy (EldoS Corp.)

Hello,

Quote
Looks like the get_Reference is not implemented or ???

VB.NET do support indexed properties (C# doesn't, so that's why you need to use setters and getters).
Your code is equivalent to:
Code
Dim Transform As TElXMLC14NTransform
Transform = TryCast(handler.References(0).TransformChain.Transforms(0), TElXMLC14NTransform)
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 4002 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!