CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondCore/DBCommon/interface/DecodingKey.h

Go to the documentation of this file.
00001 #ifndef CondCoreDBCommon_DecodingKey_H
00002 #define CondCoreDBCommon_DecodingKey_H
00003 #include <string>
00004 
00005 namespace cond {
00006 
00007   class DecodingKey {
00008 
00009     public:
00010 
00011     DecodingKey();
00012 
00013     virtual ~DecodingKey(){}
00014 
00015     bool readUserKey(const std::string& keyFileName);
00016 
00017     bool readUserKeyString(const std::string& content);
00018     
00019     bool readFromFile(const std::string& password, const std::string& keyFileName);
00020 
00021     bool readFromString(const std::string& password, const std::string& content);
00022 
00023     const std::string& key() const;
00024 
00025     const std::string& dataSource() const;
00026 
00027     static bool validateKey(const std::string& key);
00028 
00029     static std::string getUserName();
00030     
00031     static bool createFile(const std::string& password, const std::string& key,
00032                            const std::string& dataSource, const std::string& keyFileName);
00033 
00034     private:
00035 
00036     std::string m_key;
00037 
00038     std::string m_dataSource;
00039     
00040   };
00041 }
00042 
00043 inline
00044 cond::DecodingKey::DecodingKey():m_key(""),m_dataSource(""){
00045 }
00046 
00047 inline
00048 const std::string& cond::DecodingKey::key() const{
00049   return m_key;
00050 }
00051 
00052 inline
00053 const std::string& cond::DecodingKey::dataSource() const{
00054   return m_dataSource;
00055 }
00056 
00057 #endif //  CondCoreDBCommon_DecodingKey_H
00058 
00059