EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Decoding S/MIME -> "Access violation" with DecodedPart.Stream

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.
#4507
Posted: 12/17/2007 04:08:04
by Alexander Bauer (Standard support level)
Joined: 08/17/2007
Posts: 3

Hello,

i've some trouble with DecodedParts.
The decoding works without any problems. But if i want to access
the Stream of decoded parts i get an "access violation", but not at all messages.

Messages only signed => No problem.
Messages only encrypted => No problem.
Messages signed and encrypted => Access violation!

I think i did something wrong, but i don't know what ?!

Here are some lines of my sample code:

Code
// Loading the message
// FileStream will not freed!
ElMsg.ParseMessage(FileStream, '', '',
                   [mpoStoreStream, mpoLoadData, mpoCalcDataSize],
                   False, False, ActivatePartHandlers);

[...]

// Decoding the message
PartHandlerSMime := TElMessagePartHandlerSMime(ElMsgPart.MessagePartHandler);
PartHandlerSMime.CertificatesStorage := FDecoderCerts;
Res := ElMsgPart.MessagePartHandler.Decode(true);

[...]

// Try to access the decoded part stream
if assigned(ElMsgPart.MessagePartHandler.DecodedPart) then
begin
  // The stream is assigned, but seem to be freed
  ElMsgPart.MessagePartHandler.DecodedPart.Stream.Position := 0;
  LogMemo.Lines.LoadFromStream(ElMsgPart.MessagePartHandler.DecodedPart.Stream);
end;


Can you help me with that problem ?

Regards,
Alex

Reply

Statistics

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