(Answer) (Category) Crypto++ Faq-O-Matic :
Why can't I read Crypto++ objects from files via FileStore with STLport streams?
Moderator: weidai (inherited from parent)
STLport 4.5.x's (and other versions most likely) streams implementation doesn't allow seeking backwards in an istream once you've read to the stream's end. This appears to be a bug in STLport and will hopefully be fixed by them in an upcoming version. In the meantime, you may be able to work around this problem by writing an extra byte to the end of your files when you generate them. For example:
   // open a file for serialization
   CryptoPP::FileSink file("filename");
// write a Crypto++ object to the file object.DEREncode(file);
// write an extra byte so FileStore read will work file.GetStream() << '\0';

2002-May-14 8:00pm erikd
[Append to This Answer]
2002-May-14 8:00pm
Previous: (Answer) I get an "error opening file" message when I run cryptest.exe.
Next: (Answer) I compiled cryptest.exe successfully, but am getting linker errors with my own application.
This document is: http://www.cryptopp.com/cgi-bin/fom.cgi?file=72
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.721.
This FAQ is administered by Wei Dai.