Logo Search packages:      
Sourcecode: yapet version File versions  Download package

void File::writeHeader ( const Record< FileHeader > &  header,
const Key key 
) throw (YAPETException) [protected]

Writes the given header encrypted to the file.

Encrypts and writes the file header provided to the file.

header a reference to the header. It will be encrypted using the key provided.
key the key used to encrypt the header provided.

Definition at line 505 of file file.cc.

References YAPET::Crypt::encrypt().

Referenced by initFile(), and preparePWSave().


    Crypt crypt(key);
    BDBuffer* buff = NULL;
    try {
      buff = crypt.encrypt(header);
    } catch (YAPETException& ex) {
      if (buff != NULL)
          delete buff;
    } catch (...) {
      if (buff != NULL)
          delete buff;

      throw YAPETException(_("Unknown exception catched"));

    delete buff;

Generated by  Doxygen 1.6.0   Back to index