libdigidocpp
Conf.h
Go to the documentation of this file.
1 /*
2  * libdigidocpp
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  */
19 
20 #pragma once
21 
22 #include "Exception.h"
23 
24 namespace digidoc
25 {
30  {
31 
32  public:
33  struct OCSPConf { std::string issuer, url, cert; };
34  Conf() {}
35  virtual ~Conf() {}
36  static void init(Conf *conf);
37  static bool isInitialized();
38  static Conf* getInstance();
39  static void destroy();
40 
41  virtual int getLogLevel() const;
42  virtual std::string getLogFile() const;
43  virtual std::string getDigestUri() const;
44  virtual std::string getSignatureUri() const;
45  virtual std::string getManifestXsdPath() const;
46  virtual std::string getXadesXsdPath() const;
47  virtual std::string getDsigXsdPath() const;
48  virtual std::string getPKCS11DriverPath() const;
49  virtual OCSPConf getOCSP(const std::string &issuer) const;
50  virtual std::string getCertStorePath() const;
51  virtual std::string getProxyHost() const;
52  virtual std::string getProxyPort() const;
53  virtual std::string getProxyUser() const;
54  virtual std::string getProxyPass() const;
55  virtual std::string getPKCS12Cert() const;
56  virtual std::string getPKCS12Pass() const;
57  virtual bool getPKCS12Disable() const;
58 
59  virtual void setProxyHost( const std::string &host ) throw(IOException) = 0;
60  virtual void setProxyPort( const std::string &port ) throw(IOException) = 0;
61  virtual void setProxyUser( const std::string &user ) throw(IOException) = 0;
62  virtual void setProxyPass( const std::string &pass ) throw(IOException) = 0;
63  virtual void setPKCS12Cert( const std::string &cert ) throw(IOException) = 0;
64  virtual void setPKCS12Pass( const std::string &pass ) throw(IOException) = 0;
65  virtual void setPKCS12Disable( bool disable ) throw(IOException) = 0;
66 
67  virtual void setOCSP(const std::string &issuer, const std::string &url, const std::string &cert) throw(IOException) = 0;
68 
69  private:
70  Conf( const Conf& conf );
71  Conf& operator= ( const Conf& conf );
72 
73  static Conf *INSTANCE;
74  static const OCSPConf ocsplist[];
75  };
76 }