EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Verify signing file

Also by EldoS: CallbackDisk
Create virtual disks backed by memory or custom location, expose disk images as disks and more.
#9691
Posted: 04/14/2009 11:09:03
by delagoutte jean (Standard support level)
Joined: 04/02/2009
Posts: 34

sorry but i don't find how to do this.

For signing :
i'm blocked for insert the ocs presponse. i have a correct OCSP response and i want insert in the sig file.
My code :
resocsp := HTTPOCSPClient.PerformRequest(ServeroCSPResult,ReplyOcsp);
if resOCSP <> 0 then
...
->> success OCSP
elMessageSigner1.AuthenticatedAttributes.Count:=elMessageSigner1.AuthenticatedAttributes.Count+1;
elMessageSigner1.AuthenticatedAttributes.Attributes[elMessageSigner1.AuthenticatedAttributes.Count-1]:= SB_OCSP_OID_BASIC_RESPONSE;
elMessageSigner1.AuthenticatedAttributes.values[elMessageSigner1.AuthenticatedAttributes.Count-1]:= ??????????????;

how can i include the HTTPOCSPClient response in the value attributes ?

For vefifier :
i'm blocked tto, i don't know how i can use the load method.
My code :
Function GetOcsp(Attr : TElMessageVerifier):String;
var i : integer;
OCSPResp : TElOCSPResponse;
Buf : ByteArray;//array of byte;
Size : Integer;
astream : file;
begin
result:='';
for i :=0 to attr.Attributes.Count-1 do
begin
if attr.Attributes.Attributes[i]=SB_OCSP_OID_BASIC_RESPONSE then
begin
try

OCSPResp := TElOCSPResponse.create;
attr.Attributes.values[i].SaveToFile('c:\ocsp.txt');
assignfile(aStream,'c:\ocsp.txt');
reset(astream,1);
setlength(buf,filesize(astream));
blockread(astream,buf[0],length(buf));
closefile(astream);
OCSPResp.Load(@buf[0],length(buf));
result:=inttostr(OCSPResp.ResponseCount);
finally
OCSPResp.Free;

end;
end;
// result:='found';
end;
if result='' then
result:='nor found';
end;

I tried to used
a file, but because I do track method and I'm not comfortable with the buffer.
and It's not working !!
If you have a sample clean code.

Thanks for your help
#9695
Posted: 04/14/2009 23:05:11
by Ken Ivanov (EldoS Corp.)

Quote
how can i include the HTTPOCSPClient response in the value attributes ?

elMessageSigner1.AuthenticatedAttributes.values[elMessageSigner1.AuthenticatedAttributes.Count-1].Add(StringOfBytes(ReplyOCSP));

Quote
i'm blocked tto, i don't know how i can use the load method.

var
RespData: string;
Resp : TElOCSPResponse;
...
RespData := attr.Attributes.values[i][0];
Resp.Load(@RespData[1], Length(RespData));

Reply

Statistics

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