CMS 3D CMS Logo

DecodingKey.h
Go to the documentation of this file.
1 #ifndef CondCore_CondDB_DecodingKey_h
2 #define CondCore_CondDB_DecodingKey_h
3 
4 #include <iostream>
5 #include <string>
6 #include <set>
7 #include <map>
8 
9 namespace cond {
10 
11  namespace auth {
12 
18  };
19 
20  class KeyGenerator {
21  public:
22 
23  KeyGenerator();
24 
25  std::string make( size_t keySize );
26  std::string makeWithRandomSize( size_t maxSize );
27 
28  private:
29 
31 
32  };
33 
34  class DecodingKey {
35 
36  public:
37 
38  static constexpr const char* const FILE_NAME = "db.key";
39  static constexpr const char* const FILE_PATH = ".cms_cond/db.key";
40  static constexpr size_t DEFAULT_KEY_SIZE = 100;
41 
42  static std::string templateFile();
43 
44  public:
45 
46  DecodingKey();
47 
48  virtual ~DecodingKey(){}
49 
50  size_t init( const std::string& keyFileName, const std::string& password, bool readMode = true );
51 
52  size_t createFromInputFile( const std::string& inputFileName, size_t generatedKeySize = 0 );
53 
54  void list( std::ostream& out );
55 
56  void flush();
57 
58  const std::string& principalName() const;
59 
60  const std::string& principalKey() const;
61 
62  bool isNominal() const;
63 
64  const std::string& ownerName() const;
65 
66  const std::map< std::string, ServiceCredentials >& services() const;
67 
68  void addDefaultService( const std::string& connectionString );
69 
70  void addService( const std::string& serviceName, const std::string& connectionString, const std::string& userName, const std::string& password );
71 
72 
73  private:
74 
76 
77  bool m_mode;
78 
80 
82 
84 
86 
87  std::map< std::string, ServiceCredentials > m_services;
88 
89  };
90  }
91 }
92 
93 inline
95 }
96 
97 inline
98 cond::auth::ServiceCredentials::ServiceCredentials():connectionString(""),userName(""),password(""){
99 }
100 
101 inline
102 cond::auth::DecodingKey::DecodingKey():m_fileName(""),m_mode( true ),m_pwd(""),m_principalName(""),m_principalKey(""),m_owner(""),m_services(){
103 }
104 
105 inline
106 const std::string&
108  return m_principalName;
109 }
110 
111 inline
112 const std::string&
114  return m_principalKey;
115 }
116 
117 inline
118 bool
120  return !m_owner.empty();
121 }
122 
123 inline
124 const std::string&
126  return m_owner;
127 }
128 
129 inline
130 const std::map< std::string, cond::auth::ServiceCredentials >&
132 
133 #endif // CondCore_CondDB_DecodingKey_h
134 
135 
136 
const std::map< std::string, ServiceCredentials > & services() const
Definition: DecodingKey.h:131
S make(const edm::ParameterSet &cfg)
static const std::string serviceName
const std::string & ownerName() const
Definition: DecodingKey.h:125
#define constexpr
std::string m_fileName
Definition: DecodingKey.h:75
bool isNominal() const
Definition: DecodingKey.h:119
std::map< std::string, ServiceCredentials > m_services
Definition: DecodingKey.h:87
const std::string & principalName() const
Definition: DecodingKey.h:107
std::string m_principalName
Definition: DecodingKey.h:81
std::string m_principalKey
Definition: DecodingKey.h:83
Definition: plugin.cc:24
const std::string & principalKey() const
Definition: DecodingKey.h:113
templateFile
Definition: indexGen.py:50
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run