CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
swissknife_letter.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_SWISSKNIFE_LETTER_H_
6 #define CVMFS_SWISSKNIFE_LETTER_H_
7 
8 #include <string>
9 
10 #include "swissknife.h"
11 
12 namespace swissknife {
13 
14 class CommandLetter : public Command {
15  public:
17  virtual std::string GetName() const { return "letter"; }
18  virtual std::string GetDescription() const {
19  return "Signs arbitrary text with the repository certificate.";
20  }
21  virtual ParameterList GetParams() const {
22  ParameterList r;
23  r.push_back(Parameter::Switch('s', "sign text"));
24  r.push_back(Parameter::Optional('a', "hash algorithm"));
25  r.push_back(Parameter::Optional('c', "x509 certificate"));
26  r.push_back(Parameter::Optional('k', "private key of the certificate "
27  "or public master key"));
28  r.push_back(Parameter::Optional('p', "password for the private key"));
29  r.push_back(Parameter::Switch('v', "verify text"));
30  r.push_back(Parameter::Optional('m', "max age (seconds)"));
31  r.push_back(Parameter::Optional('z', "trusted certificate dir(s)"));
32  r.push_back(Parameter::Optional('r', "repository url"));
33  r.push_back(Parameter::Switch('e', "Erlang mode (stay active)"));
34  r.push_back(Parameter::Optional('t', "text to sign or verify"));
35  r.push_back(Parameter::Mandatory('f', "fully qualified repository name"));
36  return r;
37  }
38  int Main(const ArgumentList &args);
39 
40  private:
41  static const unsigned kDefaultMaxAge = 300; // 5 minutes
42 };
43 
44 } // namespace swissknife
45 
46 #endif // CVMFS_SWISSKNIFE_LETTER_H_
static Parameter Optional(const char key, const std::string &desc)
Definition: swissknife.h:41
static Parameter Switch(const char key, const std::string &desc)
Definition: swissknife.h:44
std::vector< Parameter > ParameterList
Definition: swissknife.h:71
virtual std::string GetDescription() const
static Parameter Mandatory(const char key, const std::string &desc)
Definition: swissknife.h:38
virtual ParameterList GetParams() const
int Main(const ArgumentList &args)
std::map< char, SharedPtr< std::string > > ArgumentList
Definition: swissknife.h:72
static const unsigned kDefaultMaxAge
virtual std::string GetName() const