EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Receiving an Error when PGP Encrypting a file over 400MB in size

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.
#8515
Posted: 12/22/2008 10:16:25
by Michael Mann (Basic support level)
Joined: 12/22/2008
Posts: 2

Good Day,

I am receiving an error when calling the TElPGPWriter.EncryptFiles(TElStringList SourceFileNames, ArrayList SourceStreams, String ADestFileName, Stream ADestStream) method. The file I am encrypting is 420MB in size. The error that I am getting states:

Failed to open Insert Path and file name here. The stack trace points me to the PackFilesToTar(TElStringList SourceFileNames, ArrayList SourceStreams, Boolean& DisposeStream) method where a null value is passed in for the SourceStreams argument. The type of file I am attempting to encrypt is a postscript file and I have had no problems with smaller postscript files. I have turned off compression and this did not solve the problem unless there is another property of the Writer that I need to be concerned about. Any help in this matter would be greatly appreciated.

Best Regards,
Michael
#8516
Posted: 12/22/2008 10:25:59
by Eugene Mayevski (EldoS Corp.)

Thank you for the report.

Can you please capture the call stack that we could analyze and post it here?


Sincerely yours
Eugene Mayevski
#8517
Posted: 12/22/2008 10:30:31
by Michael Mann (Basic support level)
Joined: 12/22/2008
Posts: 2

Here is the fill stack trace:

Message:Failed to open C:\PayspanHealth\HotFixQueue\NPS_V3x1x0\PSR-26\tests\Payformance.PDFRegeneration.Tests\bin\Debug\TestData\postscript.ps
Source:SecureBlackbox.PGP
TargetSite:System.IO.Stream PackFilesToTar(SBStringList.TElStringList, System.Collections.ArrayList, Boolean ByRef)
HelpLink:null
StackTrace:

at SBPGP.TElPGPWriter.PackFilesToTar(TElStringList SourceFileNames, ArrayList SourceStreams, Boolean& DisposeStream)
at SBPGP.TElPGPWriter.EncryptFiles(TElStringList SourceFileNames, ArrayList SourceStreams, String ADestFileName, Stream ADestStream)
at Payformance.Cryptography.PGPEncryption.Encrypt(FileInfo[] filesToEncrypt, FileInfo pgpFileToCreate, PGPEncryptionSettings settings) in C:\PayspanHealth\HotFixQueue\NPS_V3x1x0\PSR-26\src\Payformance\Payformance.Cryptography\PGPEncryption.cs:line 72
at Payformance.PDFRegeneration.Tests.CreateArchiveTests.verify_that_we_do_not_add_a_header_to_the_postscript_after_decrypting_the_file() in C:\PayspanHealth\HotFixQueue\NPS_V3x1x0\PSR-26\tests\Payformance.PDFRegeneration.Tests\CreateArchiveTests.cs:line 306[/code]



#8518
Posted: 12/22/2008 12:01:48
by Eugene Mayevski (EldoS Corp.)

Thank you.

When you pack multiple files to one PGP file, the temporary stream is created to save the packed TAR contents to it. When you don't handle OnCreateTemporaryStream event, then in-memory stream is created and used. This is what happened in your case. Now, if it's not enough memory to fit the file, you get an error. The solution is to handle OnCreateTemporaryStream and create a temporary file stream. Please note that such temporary stream must be deleted by your application after the operation is complete.


Sincerely yours
Eugene Mayevski

Reply

Statistics

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