EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Signature encoding

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
Posted: 11/10/2009 03:41:38
by delagoutte jean (Standard support level)
Joined: 04/02/2009
Posts: 36

I'm working on a signer verifier.
For one of signature, i had a sig file that is encoding in base64.
for decoding this sig file i used this fonction :
  PEMPROC : TelPEMProcessor;
  i : integer;
  FBASE64Buff : Array of Byte;
    PEMProc:= TelPEMProcessor.Create(nil);
    if (i=0) then
      fBase64Encoded := True;
      fBase64Encoded := False;

Now i have a other type of signature that is encode with other encoding than base 64. There is lines with 76 caracters. I think it is quotedPrintable but i'm not sure.

How can i decode this type of signature ? Is there a other component
or other method with i can decode base64 and quotedprintable or other ?
thanks for your help
Posted: 11/10/2009 04:22:27
by Ken Ivanov (Team)

SecureBlackbox includes internal non-documented functions to work with Base64 (Base64Encode, Base64Decode in SBUtils.pas). Unfortunately, there is no support for quoted-printable encoding (except that is available as a part of MIMEBlackbox) available.
Posted: 11/10/2009 04:52:36
by delagoutte jean (Standard support level)
Joined: 04/02/2009
Posts: 36

I'm note sure it is a qotedprintable encoding. I'm joining the file + sig file to this message.
Windows can open this .p7s file, could you said me if i can used a component of eldos to read this type of signature ?

[ Download ]
Posted: 11/10/2009 06:20:32
by Eugene Mayevski (Team)

Your p7s file is a detached PKCS#7 signature, encoded in Base64. You need to first decode it using B64Decode function mentioned above, then use TElMessageVerifier class to verify this signature.

Sincerely yours
Eugene Mayevski
Posted: 11/10/2009 07:58:28
by delagoutte jean (Standard support level)
Joined: 04/02/2009
Posts: 36

Sorry but i need your help for using this fonction. I can't decode.

i use it :
var fsig : file;
    fsigbuff, fBase64Buf : Array of byte;
    outsizebuff : integer;
AssignFile(FSig, aValue);
Reset(FSig, 1);
SetLength(FsigBuff, FileSize(FSig));
BlockRead(FSig, FsigBuff[0], Length(FsigBuff));

I have acess violation on base64decode fonction.
Do you see my error ?
Posted: 11/10/2009 08:25:53
by Eugene Mayevski (Team)

Of course you get - you have not allocated output buffer and didn't provide it's size to Base64Decode.

Sincerely yours
Eugene Mayevski
Posted: 11/10/2009 09:42:06
by delagoutte jean (Standard support level)
Joined: 04/02/2009
Posts: 36

thanks, effectively it works better when i allocated :)

for other user if they're needed:
        if Base64Decode(@FSigBuff[0],length(FSigBuff),@FBASE64Buff[0],outsizebuf)= BASE64_DECODE_OK then
Posted: 11/10/2009 09:43:54
by delagoutte jean (Standard support level)
Joined: 04/02/2009
Posts: 36

A other question :
Is exist a other component like elmessagesigner and elmessageverifier for xades or xmldsig signature ?
Posted: 11/10/2009 10:11:10
by Eugene Mayevski (Team)

You have a license for Professional package, which includes XMLBlackbox package (component to perform XML encryption and decryption and to create and verify XML signatures). Please check samples in Samples\XMLBlackbox folder.

Sincerely yours
Eugene Mayevski
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.



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