EldoS | Feel safer!

Software components for data protection, secure storage and transfer

simple string sign with xmlblackbox

Posted: 12/23/2012 23:39:48
by Danijel Premus (Standard support level)
Joined: 12/23/2012
Posts: 2

I just bought xmlblackbox (vcl) and signing xml documents works fine,
but I stuck with simple string signing.

Here is example that I must port from C# to Delphi.
Any example will hellp.

Best Regards


some_text_to_sign = "8594592712323.12.2012 14:44:41111125.00";

// this text must bi signed with RSA-SHA1 sign
byte[] signed_text = null;
try {

   X509Certificate2 certifikat = new X509Certificate2("c:\\certifikat.p12", "password");      
   RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)certifikat.PrivateKey;
   byte[] podaci = Encoding.ASCII.GetBytes(some_text_to_sign);
   signed_text = rsa.SignData(podaci, new SHA1CryptoServiceProvider());

   // calculate MD5
   MD5 md5Hash = MD5.Create();

   string string_result = GetMd5Hash(md5Hash, signed_text);

catch (Exception ex) {
  // on errror ...
Posted: 12/24/2012 01:30:05
by Eugene Mayevski (Team)

Please see sample in \Samples\Delphi\PKIBlackbox\Primitives\Sign folder.

Sincerely yours
Eugene Mayevski
Posted: 12/24/2012 05:34:08
by Danijel Premus (Standard support level)
Joined: 12/23/2012
Posts: 2

Thank you for you fast answer.



Topic viewed 1269 times

Number of guests: 1, 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!