diff --git a/libdigidocpp.dox b/libdigidocpp.dox index 02b4fb174..e782afeec 100644 --- a/libdigidocpp.dox +++ b/libdigidocpp.dox @@ -596,6 +596,20 @@ If left unspecified then the logging output is written to standard output stream \note For testing purposes, the SK's test time-stamping service can be used. The service is available at http://demo.sk.ee/tsa/ additional information can be found at https://www.id.ee/en/rubriik/timestamping-service/. +\subsubsection VerifyService-settings Signature Verify Service settings + + + + + + + + + +
Parameter nameComments
verify.serivceUriSpecifies the URL of the signature-verify service that is used during signature validation. By default, the RIA's signature-verify service is used by the library (https://siva.eesti.ee/V3/validate) +
+ + \subsubsection pkcs11-settings PKCS#11 settings diff --git a/src/XmlConf.cpp b/src/XmlConf.cpp index 391ddb22b..dedee6db6 100644 --- a/src/XmlConf.cpp +++ b/src/XmlConf.cpp @@ -605,10 +605,10 @@ SET1CONST(string, setPKCS12Pass, PKCS12Pass) /** * @fn void digidoc::XmlConf::setTSUrl(const std::string &url) - * Sets a PKCS#12 certificate password. Also adds or replaces PKCS#12 certificate password in the user configuration file. + * Sets a TSA service URL. Also adds or replaces TSA service URL in the user configuration file. * * @param url Target URL to connect TSA service. - * @throws Exception exception is thrown if saving a TS URL into a user configuration file fails. + * @throws Exception exception is thrown if saving a TS service URL into a user configuration file fails. */ /** * @fn void digidoc::XmlConfV2::setTSUrl(const std::string &url) @@ -624,6 +624,15 @@ SET1CONST(string, setPKCS12Pass, PKCS12Pass) */ SET1CONST(string, setTSUrl, TSUrl) +/** + * @fn void digidoc::XmlConf::setVerifyServiceUri(const std::string &url) + * Sets a Verify service URL. Also adds or replaces Verify service URL in the user configuration file. + * + * @param url Target URL to connect Verify service. + * @throws Exception exception is thrown if saving a Verify service URL into a user configuration file fails. + */ +SET1CONST(string, setVerifyServiceUri, verifyServiceUri) + /** * @fn void digidoc::XmlConf::setPKCS12Disable(bool disable) * Sets a PKCS#12 certificate usage. Also adds or replaces PKCS#12 certificate usage in the user configuration file. diff --git a/src/XmlConf.h b/src/XmlConf.h index e928c8498..48902574e 100644 --- a/src/XmlConf.h +++ b/src/XmlConf.h @@ -72,6 +72,7 @@ class DIGIDOCPP_EXPORT XmlConf: public Conf virtual void setTSLTimeOut( int timeOut ); virtual void setTSUrl(const std::string &url); + virtual void setVerifyServiceUri(const std::string &url); private: DISABLE_COPY(XmlConf); @@ -130,6 +131,7 @@ class DIGIDOCPP_EXPORT XmlConfV2: public ConfV2 virtual void setTSLTimeOut( int timeOut ); virtual void setTSUrl(const std::string &url); + virtual void setVerifyServiceUri(const std::string &url); private: DISABLE_COPY(XmlConfV2); @@ -185,6 +187,7 @@ class DIGIDOCPP_EXPORT XmlConfV3: public ConfV3 virtual void setTSLTimeOut( int timeOut ); virtual void setTSUrl(const std::string &url); + virtual void setVerifyServiceUri(const std::string &url); private: DISABLE_COPY(XmlConfV3); @@ -241,6 +244,7 @@ class DIGIDOCPP_EXPORT XmlConfV4: public ConfV4 virtual void setTSLTimeOut( int timeOut ); virtual void setTSUrl(const std::string &url); + virtual void setVerifyServiceUri(const std::string &url); private: DISABLE_COPY(XmlConfV4); diff --git a/src/libdigidocpp.i.h b/src/libdigidocpp.i.h index f4fd8a093..823e4463b 100644 --- a/src/libdigidocpp.i.h +++ b/src/libdigidocpp.i.h @@ -98,7 +98,6 @@ class SWIGEXPORT DigiDocConf: public digidoc::XmlConfCurrent else if(!cert.empty()) serviceCerts->emplace_back(cert, X509Cert::Der); } - void setVerifyServiceUri(std::string url) { serviceUrl = std::move(url); } private: DISABLE_COPY(DigiDocConf); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b90359147..52c9dfb7b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,6 +7,7 @@ if( Boost_INCLUDE_DIR ) add_definitions( -DDIGIDOCPPCONF="${CMAKE_SOURCE_DIR}/etc/schema" -DPKCS11_MODULE="${PKCS11_MODULE}" + -DSIVA_URL="${SIVA_URL}" ) add_executable(unittests libdigidocpp_boost.cpp) add_executable(TSLTests TSLTests.cpp) diff --git a/test/libdigidocpp_boost.cpp b/test/libdigidocpp_boost.cpp index 6fa475a2d..2e0ce14fa 100644 --- a/test/libdigidocpp_boost.cpp +++ b/test/libdigidocpp_boost.cpp @@ -479,7 +479,7 @@ BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE(ConfSuite) BOOST_AUTO_TEST_CASE(XmlConfCase) { - XmlConf c("digidocpp.conf", util::File::path(DIGIDOCPPCONF, "/conf.xsd")); + XmlConfCurrent c("digidocpp.conf", util::File::path(DIGIDOCPPCONF, "/conf.xsd")); BOOST_CHECK_EQUAL(c.logLevel(), 2); BOOST_CHECK_EQUAL(c.logFile(), "digidocpp.log"); BOOST_CHECK_EQUAL(c.digestUri(), URI_SHA256); @@ -493,6 +493,10 @@ BOOST_AUTO_TEST_CASE(XmlConfCase) { BOOST_CHECK_EQUAL(c.PKCS12Pass(), "pass"); BOOST_CHECK_EQUAL(c.PKCS12Disable(), true); BOOST_CHECK_EQUAL(c.ocsp("ESTEID-SK 2007"), "http://ocsp.sk.ee"); + BOOST_CHECK_EQUAL(c.verifyServiceUri(), SIVA_URL); + const string testurl = "https://test.url"; + c.setVerifyServiceUri(testurl); + BOOST_CHECK_EQUAL(c.verifyServiceUri(), testurl); } BOOST_AUTO_TEST_SUITE_END()