• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

crypt/partdec.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //
00003 // $Id: partdec.h 3342 2010-09-17 18:32:00Z java $
00004 //
00005 // Copyright (C) 2008-2010  Rafael Ostertag
00006 //
00007 // This file is part of YAPET.
00008 //
00009 // YAPET is free software: you can redistribute it and/or modify it under the
00010 // terms of the GNU General Public License as published by the Free Software
00011 // Foundation, either version 3 of the License, or (at your option) any later
00012 // version.
00013 //
00014 // YAPET is distributed in the hope that it will be useful, but WITHOUT ANY
00015 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00016 // FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00017 // details.
00018 //
00019 // You should have received a copy of the GNU General Public License along with
00020 // YAPET.  If not, see <http://www.gnu.org/licenses/>.
00021 //
00022 // Additional permission under GNU GPL version 3 section 7
00023 //
00024 // If you modify this program, or any covered work, by linking or combining it
00025 // with the OpenSSL project's OpenSSL library (or a modified version of that
00026 // library), containing parts covered by the terms of the OpenSSL or SSLeay
00027 // licenses, Rafael Ostertag grants you additional permission to convey the
00028 // resulting work.  Corresponding Source for a non-source form of such a
00029 // combination shall include the source code for the parts of OpenSSL used as
00030 // well as that of the covered work.
00031 //
00032 
00033 #ifndef _PARTDEC_H
00034 #define _PARTDEC_H
00035 
00036 #ifdef HAVE_CONFIG_H
00037 # include <config.h>
00038 #endif
00039 
00040 #ifdef HAVE_INTTYPES_H
00041 # include <inttypes.h>
00042 #endif
00043 
00044 #include "record.h"
00045 #include "key.h"
00046 #include "yapetexception.h"
00047 #include "bdbuffer.h"
00048 #include "structs.h"
00049 
00050 namespace YAPET {
00066     class PartDec {
00067         private:
00073             uint8_t name[NAME_SIZE];
00079             BDBuffer enc_data;
00080 
00081         public:
00082             PartDec();
00083 
00084             PartDec (BDBuffer& bd,
00085                      const Key& key) throw (YAPETException);
00086 
00087             PartDec (Record<PasswordRecord>& pr,
00088                      const Key& key) throw (YAPETException);
00089 
00090             PartDec (const PartDec& pd);
00091 
00092             ~PartDec();
00093 
00094             void setRecord (Record<PasswordRecord>& pr,
00095                             const Key& key) throw (YAPETException);
00105             inline const BDBuffer& getEncRecord() const {
00106                 return enc_data;
00107             }
00117             inline const uint8_t* getName() const {
00118                 return name;
00119             }
00128             inline const char* c_str() const {
00129                 return (char*) name;
00130             }
00131             const PartDec& operator= (const PartDec& pd);
00132 
00133             bool operator< (const PartDec& pd) const;
00134     };
00135 }
00136 
00137 #endif // _PARTDEC_H

Generated on Sun Sep 19 2010 15:37:13 for YAPET by  doxygen 1.7.1