diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 12:19:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-05 14:25:02 +0100 |
commit | ddd43218e9900536381733735adf8681d345e775 (patch) | |
tree | 5bb211e63d9b739d20eb248f1ab9f0fb481e118d /xmlsecurity | |
parent | 9c036b1d3db253a1fd43ce76ce1d919e2029af59 (diff) |
drop sax::tools::*base64 methods
and use the underlying comphelper methods rather. This is so that I can
break the dependency that tools has on sax, and can add methods that
make sax depend on tools.
Change-Id: I8a2d6ce2ffc3529a0020710ade6a1748ee5af7d5
Reviewed-on: https://gerrit.libreoffice.org/50767
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/component/documentdigitalsignatures.cxx | 3 | ||||
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturemanager.cxx | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 2978bd133522..e6dab417f93c 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -41,6 +41,7 @@ #include <vcl/weld.hxx> #include <unotools/securityoptions.hxx> #include <com/sun/star/security/CertificateValidity.hpp> +#include <comphelper/base64.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> @@ -634,7 +635,7 @@ void DocumentDigitalSignatures::addAuthorToTrustedSources( aNewCert[ 1 ] = xmlsecurity::bigIntegerToNumericString( Author->getSerialNumber() ); OUStringBuffer aStrBuffer; - ::sax::Converter::encodeBase64(aStrBuffer, Author->getEncoded()); + ::comphelper::Base64::encode(aStrBuffer, Author->getEncoded()); aNewCert[ 2 ] = aStrBuffer.makeStringAndClear(); diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 81a61791fc3a..c287b5234063 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/xml/crypto/SEInitializer.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/base64.hxx> #include <comphelper/storagehelper.hxx> #include <rtl/ustrbuf.hxx> #include <sax/tools/converter.hxx> @@ -289,13 +290,13 @@ bool DocumentSignatureManager::add( nSecurityId = maSignatureHelper.GetNewSecurityId(); OUStringBuffer aStrBuffer; - sax::Converter::encodeBase64(aStrBuffer, xCert->getEncoded()); + comphelper::Base64::encode(aStrBuffer, xCert->getEncoded()); OUString aKeyId; if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get())) { OUStringBuffer aBuffer; - sax::Converter::encodeBase64(aBuffer, pCertificate->getSHA256Thumbprint()); + comphelper::Base64::encode(aBuffer, pCertificate->getSHA256Thumbprint()); aKeyId = aBuffer.makeStringAndClear(); } else @@ -334,13 +335,13 @@ bool DocumentSignatureManager::add( nSecurityId = maSignatureHelper.GetNewSecurityId(); OUStringBuffer aStrBuffer; - sax::Converter::encodeBase64(aStrBuffer, xCert->getEncoded()); + comphelper::Base64::encode(aStrBuffer, xCert->getEncoded()); OUString aCertDigest; if (auto pCertificate = dynamic_cast<xmlsecurity::Certificate*>(xCert.get())) { OUStringBuffer aBuffer; - sax::Converter::encodeBase64(aBuffer, pCertificate->getSHA256Thumbprint()); + comphelper::Base64::encode(aBuffer, pCertificate->getSHA256Thumbprint()); aCertDigest = aBuffer.makeStringAndClear(); } else @@ -359,7 +360,7 @@ bool DocumentSignatureManager::add( OUStringBuffer aStrBuffer; for (int i = 0; i < nCnt; i++) { - sax::Converter::encodeBase64(aStrBuffer, pCertPath[i]->getEncoded()); + comphelper::Base64::encode(aStrBuffer, pCertPath[i]->getEncoded()); maSignatureHelper.AddEncapsulatedX509Certificate(aStrBuffer.makeStringAndClear()); } |