EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Simple Console Application Sample

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#25836
Posted: 07/25/2013 09:38:56
by Özer DURMAZ (Basic support level)
Joined: 07/25/2013
Posts: 1

Hi,

Is there any "simple" console application sample for c# about Signing an XML with XAdES?
I want to sign an simple xml like above. How can I do this?

I'm using a pfx certificate to sign xml.

unsigned xml:
Quote

<?xml version="1.0" encoding="ISO-8859-9"?>
<license>
<computerName>MYCOMPUTER</computerName>
<expires>2003-09-31T00:00:00</expires>
</license>

signed xml should be like:
Quote

<?xml version="1.0" encoding="ISO-8859-9"?>
<license>
<computerName>MYCOMPUTER</computerName>
<expires>2003-09-31T00:00:00</expires>
<SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI="" Type="http://www.gzs.si/shemas/eslog/racun/1.5#Racun"><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>qz10+DILWWJgVSDLQwizHcZSqKA=</DigestValue></Reference><Reference URI="#SignedPropertiesId" Type="http://uri.etsi.org/01903/v1.1.1#SignedProperties"><Transforms><Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>CwFBsin9s7+q6Iq3byuvVagZ81o=</DigestValue></Reference>GzAtWf5fZbVOqafdEgN0oo3/H71s1tFgYuSIth8T69J7nZE81yMppSkj1Fl+8rYW34UBuVLgvdpsH7yDRu3jyu0Vr9spLQyRQMDW/x/4ijTP6tpvlxYbVT+G1jvzVw26QCoS4uyzarOJ+M3w1N63qhUEF/ptzccF0+PP3Aom8gvLyiXh/jqikCKvLx4QGIzAEiNQjYQwOOR2k4s/pJfOvkl1K4ie/iMyn...PuUA/bFFvmZM4dbVArpMoIUTuHJbJTXHGqtDzfCgEb/dYIzfUA==<KeyInfo><X509Data><X509Certificate>MIIF...fWV5+GRbNQTnVpG5naG/4xC167blIngQJdOJVss7LSBjFkOOitvJtpV0Qvsld1HzW9A+P8aR17KdgZzqsc5+akR0+volN2ZH9M+q0Xza7zSQjgBzovv2R6VQWLnEyFb4i3PzEqQMDbF8n30oNWj0BjBvNn+eTkxmk8ifhLDAwrrDasje5CudTNo9pIv73VcJqA3F+pKwW7MGIZeDJpLnbbqz+ELOIR3ev51Ewb889QQyqlMiu2LKaDVmpsFzAlFo25ayLTJ896/cL0Lff+/W+CKeOo3f/SrAcZWp0RWmiKZDET9LqCodeH+2x3M8+KK2IwjABk378e8/Tipj...DwEB/wQEA...EwEB/wQCM...tQf5/4+qEZrubSB9W5vjslgmCAiWg5b02DGxknjlrCpaXWq2WnBo2r5t2wCXkVXSpHYPmx+AkJI7R0vOeUrNwMJokjDRG8iII2hUqrdqC+7eOKVPaoNcn1LKbvg8bMde3qcfMF1FFgCSQaonu/3H1h...Avm1/noiTbziLj34Ayxz3/srXAJlp+9Z47...FVBR/l/gtIYiBsR9lpib3+Lv9g0Gorz/5XQ==</X509Certificate></X509Data></KeyInfo><Object><QualifyingProperties Target="#SignatureId" xmlns="http://uri.etsi.org/01903/v1.1.1#"><SignedSignatureProperties><SigningTime>2013-07-13T16:45:51.157Z<Cert><CertDigest><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>TpU84mnLwakEkm7jy4Lft363VRk=</DigestValue></CertDigest><X509IssuerName xmlns="http://www.w3.org/2000/09/xmldsig#">CN=Mali Mühür Elektronik Sertifika Hizmet Sağlayıcısı - Sürüm 1, C=TR</X509IssuerName><X509SerialNumber xmlns="http://www.w3.org/2000/09/xmldsig#">009A5A19C46A</X509SerialNumber></Cert></SignedSignatureProperties></SignedProperties></QualifyingProperties></Object></Signature></license>
#25838
Posted: 07/25/2013 09:49:45
by Eugene Mayevski (EldoS Corp.)

Thank you for contacting us.

All existing samples are available in <SecureBlackbox>\Samples\<language>\XMLBlackbox folder (in particular you would need AdvancedSigner). There's no "simple" sample for XAdES because XAdES itself is complicated and very flexible in regards to what and how to sign.

Custom samples and "can you do this for me" tasks are available as a custom service for a fee.


Sincerely yours
Eugene Mayevski

Reply

Statistics

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