diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-06-20 10:58:26 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-06-21 22:16:55 +0200 |
commit | e4adff468c8f5e6fbacae0f553d7c154fb95a466 (patch) | |
tree | 3279a46f653c16d5b5a7b23df5f27832677acb37 /xmlsecurity | |
parent | bb06a106aa92dae05b2d05a46c6c6586e9b84b7c (diff) |
gpg4libre: List both (x509 and gpg) existing signatures
Change-Id: I57ae79f7632885bf5c5aadcad3fb5ad4a5a9413d
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 4dec1d784d17..aac3ca15bc30 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -32,6 +32,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/security/CertificateValidity.hpp> #include <com/sun/star/packages/WrongPasswordException.hpp> +#include <com/sun/star/security/CertificateKind.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/xml/dom/XDocumentBuilder.hpp> #include <com/sun/star/packages/manifest/ManifestReader.hpp> @@ -554,9 +555,13 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox() { //check the validity of the cert try { - // TODO: check for both sec envs ... - sal_Int32 certResult = xGpgSecEnv->verifyCertificate(xCert, - Sequence<css::uno::Reference<css::security::XCertificate> >()); + sal_Int32 certResult; + if (xCert->getCertificateKind() == CertificateKind_OPENPGP) + certResult = xGpgSecEnv->verifyCertificate(xCert,Sequence<css::uno::Reference<css::security::XCertificate> >()); + else if (xCert->getCertificateKind() == CertificateKind_X509) + certResult = xSecEnv->verifyCertificate(xCert, Sequence<css::uno::Reference<css::security::XCertificate> >()); + else + throw RuntimeException("Unknown certificate kind"); bCertValid = certResult == css::security::CertificateValidity::VALID; if ( bCertValid ) |