EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How can add references tag to keyinfo

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#25816
Posted: 07/25/2013 04:25:07
by massimiliano nonnis (Standard support level)
Joined: 07/24/2013
Posts: 9

Hy
How can add references tag to keyinfo like this example:

<Reference Id="xmldsig-5a0521c1-fcce-4178-b6a1-fe4df69d2719" URI="#idKeyInfo">
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>2ekZqP3twu/z4uVnC5WSmA07TagIkxELlSV25nwdukw=</DigestValue>
</Reference>

this tag is referenced at tag keyinfo this

<KeyInfo Id="idKeyInfo">
<X509Data>
<X509Certificate>.....</X509Certificate>
</X509Data>
</KeyInfo>
than's for help
#25819
Posted: 07/25/2013 05:01:38
by massimiliano nonnis (Standard support level)
Joined: 07/24/2013
Posts: 9

if use this code
Ref = new TElXMLReference();
Ref.DigestMethod = SBXMLSec.Unit.xdmSHA256;
Ref.URI = "#KeyInfo-01336266";
Ref.ID = "Reference-71336266";
Refs.Add(Ref);
Signer.References = Refs;
Signer.Signature.KeyInfo.ID = "KeyInfo-01336266";
....
Signer.UpdateReferencesDigest();

I get this error "Reference require context."
which property set?
Ref.URINode
Ref.URIStream
#25822
Posted: 07/25/2013 07:21:05
by Alexander Ionov (EldoS Corp.)

Thank you for the question.

Firstly the URIData property is checked, then the URINode property, and the last one - URIStream. If none of these properties is set, the mentioned exception is thrown. So you have to set any of them depending on your data source.


--
Best regards,
Alexander Ionov
#25826
Posted: 07/25/2013 08:07:13
by massimiliano nonnis (Standard support level)
Joined: 07/24/2013
Posts: 9

thanks
if use this code works

Signer.UpdateReferencesDigest();

Ref = new TElXMLReference();
Ref.DigestMethod = SBXMLSec.Unit.xdmSHA256;
Ref.URI = "#KeyInfo-01336266";
Ref.ID = "Reference-71336266";
Refs.Add(Ref);
Signer.References = Refs;
Signer.Signature.KeyInfo.ID = "KeyInfo-01336266";

Reply

Statistics

Topic viewed 1016 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!