libdigidocpp
|
#include <XmlConf.h>
Public Member Functions | |
XmlConf () throw (IOException) | |
XmlConf (const std::string &path) throw (IOException) | |
virtual | ~XmlConf () |
virtual int | getLogLevel () const |
virtual std::string | getLogFile () const |
virtual std::string | getDigestUri () const |
virtual std::string | getSignatureUri () const |
virtual std::string | getManifestXsdPath () const |
virtual std::string | getXadesXsdPath () const |
virtual std::string | getDsigXsdPath () const |
virtual std::string | getPKCS11DriverPath () const |
virtual OCSPConf | getOCSP (const std::string &issuer) const |
virtual std::string | getCertStorePath () const |
virtual std::string | getProxyHost () const |
virtual std::string | getProxyPort () const |
virtual std::string | getProxyUser () const |
virtual std::string | getProxyPass () const |
virtual std::string | getPKCS12Cert () const |
virtual std::string | getPKCS12Pass () const |
virtual bool | getPKCS12Disable () const |
virtual void | setProxyHost (const std::string &host) throw (IOException) |
virtual void | setProxyPort (const std::string &port) throw (IOException) |
virtual void | setProxyUser (const std::string &user) throw (IOException) |
virtual void | setProxyPass (const std::string &pass) throw (IOException) |
virtual void | setPKCS12Cert (const std::string &cert) throw (IOException) |
virtual void | setPKCS12Pass (const std::string &pass) throw (IOException) |
virtual void | setPKCS12Disable (bool disable) throw (IOException) |
virtual void | setOCSP (const std::string &issuer, const std::string &url, const std::string &cert) throw (IOException) |
![]() | |
Conf () | |
virtual | ~Conf () |
Static Public Member Functions | |
static void | initialize () |
static std::string | getUserConfDir () |
static std::string | getDefaultConfDir () |
![]() | |
static void | init (Conf *conf) |
static bool | isInitialized () |
static Conf * | getInstance () |
static void | destroy () |
Private Attributes | |
XmlConfPrivate * | d |
XmlConf::XmlConf | ( | ) | throw (IOException) |
Tries to initialize XmlConf by using file defined in DIGIDOCPP_OVERRIDE_CONF environment variable. If this is undefined, tries to load configuration from defined Default and user configuration file
Definition at line 240 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::DEFAULT_CONF_LOC, e, digidoc::util::File::fileExists(), digidoc::Exception::getMsg(), digidoc::XmlConfPrivate::init(), digidoc::XmlConfPrivate::USER_CONF_LOC, and WARN.
Referenced by initialize().
XmlConf::XmlConf | ( | const std::string & | path | ) | throw (IOException) |
Initialize xml conf from path
path | to use for initializing conf |
Definition at line 268 of file XmlConf.cpp.
|
virtual |
Definition at line 274 of file XmlConf.cpp.
References d.
|
virtual |
Gets Certificate store location.
Reimplemented from digidoc::Conf.
Definition at line 476 of file XmlConf.cpp.
References digidoc::XmlConfPrivate::certStorePath, d, getDefaultConfDir(), digidoc::util::File::isRelative(), digidoc::util::File::path(), and digidoc::XmlConfParam< A >::value.
|
static |
Gets default configuration file directory.
Definition at line 283 of file XmlConf.cpp.
References digidoc::util::File::cwd(), digidoc::XmlConfPrivate::DEFAULT_CONF_LOC, and digidoc::util::File::directory().
Referenced by digidoc::DDocLibrary::DDocLibrary(), getCertStorePath(), getDsigXsdPath(), getManifestXsdPath(), getXadesXsdPath(), digidoc::XmlConfPrivate::read(), and digidoc::XmlConfPrivate::serializeUserConf().
|
virtual |
Digest method used to calculate digest values in BDOC (e.g. 'http://www.w3.org/2000/09/xmldsig#sha1' for SHA1)
For available method URIs see:
W3C XML Encryption Syntax and Processing (10 December 2005) http://www.w3.org/TR/xmlenc-core/
RFC 4051 http://www.ietf.org/rfc/rfc4051.txt
Reimplemented from digidoc::Conf.
Definition at line 387 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::digestUri, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets Dsig schema file location.
Reimplemented from digidoc::Conf.
Definition at line 442 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::dsigXsdPath, digidoc::util::File::fullPathUrl(), getDefaultConfDir(), and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets log file location.
Reimplemented from digidoc::Conf.
Definition at line 371 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::logFile, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets log level.
Reimplemented from digidoc::Conf.
Definition at line 362 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::logLevel, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets Manifest schema file location.
Reimplemented from digidoc::Conf.
Definition at line 422 of file XmlConf.cpp.
References d, digidoc::util::File::fullPathUrl(), getDefaultConfDir(), digidoc::XmlConfPrivate::manifestXsdPath, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets OCSP data by issuer.
issuer | OCSP issuer. |
Reimplemented from digidoc::Conf.
Definition at line 462 of file XmlConf.cpp.
References d, i, and digidoc::XmlConfPrivate::ocsp.
|
virtual |
Gets PKCS11 driver file path.
Reimplemented from digidoc::Conf.
Definition at line 452 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::pkcs11DriverPath, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets PKCS12 certificate file location.
Reimplemented from digidoc::Conf.
Definition at line 527 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::pkcs12Cert, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets PKCS12 usage.
Reimplemented from digidoc::Conf.
Definition at line 545 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::pkcs12Disable, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets PKCS12 password.
Reimplemented from digidoc::Conf.
Definition at line 536 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::pkcs12Pass, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets proxy host address.
Reimplemented from digidoc::Conf.
Definition at line 491 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::proxyHost, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets proxy login password.
Reimplemented from digidoc::Conf.
Definition at line 518 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::proxyPass, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets proxy port number.
Reimplemented from digidoc::Conf.
Definition at line 500 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::proxyPort, and digidoc::XmlConfParam< A >::value.
|
virtual |
Gets proxy user name.
Reimplemented from digidoc::Conf.
Definition at line 509 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::proxyUser, and digidoc::XmlConfParam< A >::value.
|
virtual |
Signature method used to calculate signature value in BDOC (e.g. 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' for SHA1)
For available method URIs see:
W3C XML Encryption Syntax and Processing (10 December 2005) http://www.w3.org/TR/xmlenc-core/
RFC 4051 http://www.ietf.org/rfc/rfc4051.txt
Reimplemented from digidoc::Conf.
Definition at line 403 of file XmlConf.cpp.
References d, digidoc::XmlConfPrivate::signatureUri, and digidoc::XmlConfParam< A >::value.
|
static |
Gets user specific configuration file directory.
Definition at line 413 of file XmlConf.cpp.
References digidoc::util::File::directory(), and digidoc::XmlConfPrivate::USER_CONF_LOC.
Referenced by digidoc::XmlConfPrivate::serializeUserConf().
|
virtual |
Gets Xades schema file location.
Reimplemented from digidoc::Conf.
Definition at line 432 of file XmlConf.cpp.
References d, digidoc::util::File::fullPathUrl(), getDefaultConfDir(), digidoc::XmlConfParam< A >::value, and digidoc::XmlConfPrivate::xadesXsdPath.
|
static |
Use digidoc::XmlConf as configuration instance.
Definition at line 229 of file XmlConf.cpp.
References digidoc::Conf::init(), digidoc::Conf::isInitialized(), and XmlConf().
Referenced by digidoc::initialize().
|
virtual |
Adds or replaces OCSP parameters in the user configuration file.
IOException | exception is thrown if saving an OCSP parameters into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 657 of file XmlConf.cpp.
References e, digidoc::util::File::fileExists(), THROW_IOEXCEPTION, and digidoc::XmlConfPrivate::USER_CONF_LOC.
|
virtual |
Sets a PKCS#12 certficate path. Also adds or replaces PKCS#12 certificate path in the user configuration file. By default the PKCS#12 certificate file should be located at default path, given by getUserConfDir() function.
cert | PKCS#12 certificate location path. |
IOException | exception is thrown if saving a PKCS#12 certificate path into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 613 of file XmlConf.cpp.
References digidoc::XmlConfPrivate::PKCS12_CERT.
|
virtual |
Sets a PKCS#12 certificate usage. Also adds or replaces PKCS#12 certificate usage in the user configuration file.
pass | PKCS#12 certificate usage. |
IOException | exception is thrown if saving a PKCS#12 certificate usage into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 641 of file XmlConf.cpp.
References digidoc::XmlConfPrivate::PKCS12_DISABLE.
|
virtual |
Sets a PKCS#12 certificate password. Also adds or replaces PKCS#12 certificate password in the user configuration file.
pass | PKCS#12 certificate password. |
IOException | exception is thrown if saving a PKCS#12 certificate password into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 627 of file XmlConf.cpp.
References pass, and digidoc::XmlConfPrivate::PKCS12_PASS.
|
virtual |
Sets a Proxy host address. Also adds or replaces proxy host data in the user configuration file.
host | proxy host address. |
IOException | exception is thrown if saving a proxy host address into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 556 of file XmlConf.cpp.
References digidoc::XmlConfPrivate::PROXY_HOST.
|
virtual |
Sets a Proxy password. Also adds or replaces proxy password in the user configuration file.
pass | proxy password. |
IOException | exception is thrown if saving a proxy password into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 598 of file XmlConf.cpp.
References pass, and digidoc::XmlConfPrivate::PROXY_PASS.
|
virtual |
Sets a Proxy port number. Also adds or replaces proxy port data in the user configuration file.
port | proxy port number. |
IOException | exception is thrown if saving a proxy port number into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 570 of file XmlConf.cpp.
References digidoc::XmlConfPrivate::PROXY_PORT.
|
virtual |
Sets a Proxy user name. Also adds or replaces proxy user name in the user configuration file.
user | proxy user name. |
IOException | exception is thrown if saving a proxy user name into a user configuration file fails. |
Implements digidoc::Conf.
Definition at line 584 of file XmlConf.cpp.
References digidoc::XmlConfPrivate::PROXY_USER.
|
private |
Definition at line 68 of file XmlConf.h.
Referenced by getCertStorePath(), getDigestUri(), getDsigXsdPath(), getLogFile(), getLogLevel(), getManifestXsdPath(), getOCSP(), getPKCS11DriverPath(), getPKCS12Cert(), getPKCS12Disable(), getPKCS12Pass(), getProxyHost(), getProxyPass(), getProxyPort(), getProxyUser(), getSignatureUri(), getXadesXsdPath(), XmlConf(), and ~XmlConf().