EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Generete Digestvalue, x509Certificate and signaturevalue

#5794
Posted: 04/09/2008 07:43:52
by Gabriel Herdt (Standard support level)
Joined: 04/09/2008
Posts: 37

Hi, I try generate Digestvalue, x509Certificate and signaturevalue using Capicom.dll in delphi 2005 But i Dont have success. Is possible create 3 function receive my xml text and result in my tags Digestvalue, x509Certificate and signature ?? Using Eldos Component.



<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="#Nfe51080303941052001718550010000123260000123269">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
<Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>MIIBvAYJKoZIhvcNAQcDoIIB....dnI1QnwZ/mAKg==</DigestValue>
</Reference>

MIIIjgYJKoZIhvcNAQcDoIIIf...EFcxiIXkw7Y2vxgbew==
<KeyInfo>
<X509Data>
<X509Certificate>MIIFX...Y42vINzceOfEf4Ohn1Yt3AWkxAA==</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>


Gabriel Herdt
Consystec
#5798
Posted: 04/09/2008 08:04:35
by Eugene Mayevski (Team)

You can't just create the tags, but you can sign the document using our components. See the sample application in "<SecureBlackbox.VCL>\Samples\XML\Signer\" folder for this.


Sincerely yours
Eugene Mayevski
#5801
Posted: 04/09/2008 08:14:47
by Gabriel Herdt (Standard support level)
Joined: 04/09/2008
Posts: 37

Ok, But i don't have file. Only Xml Text. How can I move my xml.txt to be signed?


Gabriel Herdt
Consystec
#5802
Posted: 04/09/2008 08:18:56
by Eugene Mayevski (Team)

SecureBlackbox works with streams, not with files. So you can put your text to TStringStream and pass the stream to the XML signer component. See the how-to in the knowledgebase.


Sincerely yours
Eugene Mayevski
#5804
Posted: 04/09/2008 08:55:52
by Gabriel Herdt (Standard support level)
Joined: 04/09/2008
Posts: 37

I see Document in my pc.
But you have example :D ??


Gabriel Herdt
Consystec
#5806
Posted: 04/09/2008 09:43:08
by Eugene Mayevski (Team)

read the above.


Sincerely yours
Eugene Mayevski
#5837
Posted: 04/10/2008 16:16:55
by Gabriel Herdt (Standard support level)
Joined: 04/09/2008
Posts: 37

Hi again.
I Need Example Using command ParseEleme­ntFromXMLString in delphi 2005 and sing one or more assinatures in one xml?


Gabriel Herdt
Consystec
#5838
Posted: 04/10/2008 17:50:42
by Dmytro Bogatskyy (Team)

Quote
I Need Example Using command ParseElementFromXMLString in delphi 2005 and sing one or more assinatures in one xml?

If you have data in Unicode (WideString) and it is in form "<tag_name>...</tag_name>", then use following code to create xml document:
Code
var
  Document: TElXMLDOMDocument;
  Element: TElXMLDOMElement;

Element := ParseElementFromXMLString(Data, Document)
if Element <> nil then
  Document.AppendChild(Element); // append parsed element as DocumentElement (root element)

How to sign this document see XML\SimpleSigner sample.
#5851
Posted: 04/11/2008 09:02:09
by Gabriel Herdt (Standard support level)
Joined: 04/09/2008
Posts: 37

I found command "X509KeyData.IncludeKeyValue := False;" but my sing have tag X509SubjectName,
How I do not enter the tag X509SubjectName???


Gabriel Herdt
Consystec
#5852
Posted: 04/11/2008 09:11:17
by Dmytro Bogatskyy (Team)

Quote
How I do not enter the tag X509SubjectName???

You can control X509SubjectName tag appearance using IncludeDataParams property.

Reply

Statistics

Topic viewed 63322 times

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




|

Back to top

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

Got it!