libdigidocpp
digidoc::XmlConf Class Reference

#include <XmlConf.h>

Inheritance diagram for digidoc::XmlConf:
Inheritance graph
Collaboration diagram for digidoc::XmlConf:
Collaboration graph

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)
- Public Member Functions inherited from digidoc::Conf
 Conf ()
virtual ~Conf ()

Static Public Member Functions

static void initialize ()
static std::string getUserConfDir ()
static std::string getDefaultConfDir ()
- Static Public Member Functions inherited from digidoc::Conf
static void init (Conf *conf)
static bool isInitialized ()
static ConfgetInstance ()
static void destroy ()

Private Attributes

XmlConfPrivated

Detailed Description

Definition at line 28 of file XmlConf.h.

Constructor & Destructor Documentation

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().

Here is the call graph for this function:

Here is the caller graph for this function:

XmlConf::XmlConf ( const std::string &  path) throw (IOException)

Initialize xml conf from path

Parameters
pathto use for initializing conf
Returns

Definition at line 268 of file XmlConf.cpp.

XmlConf::~XmlConf ( )
virtual

Definition at line 274 of file XmlConf.cpp.

References d.

Member Function Documentation

std::string XmlConf::getCertStorePath ( ) const
virtual

Gets Certificate store location.

Returns
Certificate store full path 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.

Here is the call graph for this function:

std::string XmlConf::getDefaultConfDir ( )
static

Gets default configuration file directory.

Returns
default configuration file directory full path.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string XmlConf::getDigestUri ( ) const
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

Returns

Reimplemented from digidoc::Conf.

Definition at line 387 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::digestUri, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getDsigXsdPath ( ) const
virtual

Gets Dsig schema file location.

Returns
Dsig schema full path 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.

Here is the call graph for this function:

std::string XmlConf::getLogFile ( ) const
virtual

Gets log file location.

Returns
log path location.

Reimplemented from digidoc::Conf.

Definition at line 371 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::logFile, and digidoc::XmlConfParam< A >::value.

int XmlConf::getLogLevel ( ) const
virtual

Gets log level.

Returns
log level.

Reimplemented from digidoc::Conf.

Definition at line 362 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::logLevel, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getManifestXsdPath ( ) const
virtual

Gets Manifest schema file location.

Returns
Manifest schema full path 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.

Here is the call graph for this function:

Conf::OCSPConf XmlConf::getOCSP ( const std::string &  issuer) const
virtual

Gets OCSP data by issuer.

Parameters
issuerOCSP issuer.
Returns
returns OCSP data structure, containing issuer, url and certificate location.

Reimplemented from digidoc::Conf.

Definition at line 462 of file XmlConf.cpp.

References d, i, and digidoc::XmlConfPrivate::ocsp.

std::string XmlConf::getPKCS11DriverPath ( ) const
virtual

Gets PKCS11 driver file path.

Returns
PKCS11 driver file location.

Reimplemented from digidoc::Conf.

Definition at line 452 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::pkcs11DriverPath, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getPKCS12Cert ( ) const
virtual

Gets PKCS12 certificate file location.

Returns
PKCS12 certificate full path location.

Reimplemented from digidoc::Conf.

Definition at line 527 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::pkcs12Cert, and digidoc::XmlConfParam< A >::value.

bool XmlConf::getPKCS12Disable ( ) const
virtual

Gets PKCS12 usage.

Returns
PKCS12 usage.

Reimplemented from digidoc::Conf.

Definition at line 545 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::pkcs12Disable, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getPKCS12Pass ( ) const
virtual

Gets PKCS12 password.

Returns
PKCS12 password.

Reimplemented from digidoc::Conf.

Definition at line 536 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::pkcs12Pass, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getProxyHost ( ) const
virtual

Gets proxy host address.

Returns
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.

std::string XmlConf::getProxyPass ( ) const
virtual

Gets proxy login password.

Returns
proxy password.

Reimplemented from digidoc::Conf.

Definition at line 518 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::proxyPass, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getProxyPort ( ) const
virtual

Gets proxy port number.

Returns
proxy port.

Reimplemented from digidoc::Conf.

Definition at line 500 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::proxyPort, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getProxyUser ( ) const
virtual

Gets proxy user name.

Returns
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.

std::string XmlConf::getSignatureUri ( ) const
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

Returns

Reimplemented from digidoc::Conf.

Definition at line 403 of file XmlConf.cpp.

References d, digidoc::XmlConfPrivate::signatureUri, and digidoc::XmlConfParam< A >::value.

std::string XmlConf::getUserConfDir ( )
static

Gets user specific configuration file directory.

Returns
returns user 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().

Here is the call graph for this function:

Here is the caller graph for this function:

std::string XmlConf::getXadesXsdPath ( ) const
virtual

Gets Xades schema file location.

Returns
Xades schema full path 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.

Here is the call graph for this function:

void XmlConf::initialize ( )
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().

Here is the call graph for this function:

Here is the caller graph for this function:

void XmlConf::setOCSP ( const std::string &  issuer,
const std::string &  url,
const std::string &  cert 
) throw (IOException)
virtual

Adds or replaces OCSP parameters in the user configuration file.

Parameters
issueran ocsp certificate issuer.
urlan OCSP server url.
certan OCSP certificate CN.
Exceptions
IOExceptionexception 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.

Here is the call graph for this function:

void XmlConf::setPKCS12Cert ( const std::string &  cert) throw (IOException)
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.

Parameters
certPKCS#12 certificate location path.
Exceptions
IOExceptionexception 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.

void XmlConf::setPKCS12Disable ( bool  disable) throw (IOException)
virtual

Sets a PKCS#12 certificate usage. Also adds or replaces PKCS#12 certificate usage in the user configuration file.

Parameters
passPKCS#12 certificate usage.
Exceptions
IOExceptionexception 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.

void XmlConf::setPKCS12Pass ( const std::string &  pass) throw (IOException)
virtual

Sets a PKCS#12 certificate password. Also adds or replaces PKCS#12 certificate password in the user configuration file.

Parameters
passPKCS#12 certificate password.
Exceptions
IOExceptionexception 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.

void XmlConf::setProxyHost ( const std::string &  host) throw (IOException)
virtual

Sets a Proxy host address. Also adds or replaces proxy host data in the user configuration file.

Parameters
hostproxy host address.
Exceptions
IOExceptionexception 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.

void XmlConf::setProxyPass ( const std::string &  pass) throw (IOException)
virtual

Sets a Proxy password. Also adds or replaces proxy password in the user configuration file.

Parameters
passproxy password.
Exceptions
IOExceptionexception 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.

void XmlConf::setProxyPort ( const std::string &  port) throw (IOException)
virtual

Sets a Proxy port number. Also adds or replaces proxy port data in the user configuration file.

Parameters
portproxy port number.
Exceptions
IOExceptionexception 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.

void XmlConf::setProxyUser ( const std::string &  user) throw (IOException)
virtual

Sets a Proxy user name. Also adds or replaces proxy user name in the user configuration file.

Parameters
userproxy user name.
Exceptions
IOExceptionexception 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.

Member Data Documentation


The documentation for this class was generated from the following files: