EldoS | Feel safer!

Software components for data protection, secure storage and transfer

String sign

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#13859
Posted: 07/07/2010 12:49:10
by Ken Ivanov (EldoS Corp.)

Could you please post two signatures, one created by OpenSSL (either under Windows or Linux) and another created with your TFileStream-based revision of the code here?
#13861
Posted: 07/07/2010 13:34:48
by Guilherme Soares (Standard support level)
Joined: 01/09/2008
Posts: 6

Now its running,

the solution is writing on a temp file the string i want to sign, and sign the file


Code
        //also tried with ascii < 32 and no problem
        StringStream := TStringStream.Create( 'Message to sign "" etc.');

        FileStream := TFileStream.Create( FilePath+'filetosign'  , fmCreate );
        FileStream.Write( StringStream , StringStream.Size );
        FileStream.Destroy;

        FileStream := TFileStream.Create( FilePath+'filetosign'  , fmOpenRead );

        Crypto.SignDetached( FileStream , SignStringStream );

        FileStream.Destroy;

        inputbox( '' , '' , SignStringStream.DataString );


running on linux
cat filetosign | openssl dgst -sha1 -sign privatekey.pem | openssl enc -base64

on windows
type filetosign | openssl dgst -sha1 -sign privatekey.pem | openssl enc -base64


Now all gives the same result

Thank you

Reply

Statistics

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