summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/gpg/SecurityEnvironment.cxx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-08-23 00:06:21 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-09-03 01:10:11 +0200
commit9c165fe3084b7c054f9f04f3b065897abcbe2162 (patch)
treebf2a797ba716bd106fb724fd1526f0e5ec4eaf71 /xmlsecurity/source/gpg/SecurityEnvironment.cxx
parent4f6bf3d64cf3fcbe92be3ceb4b572ad038c131a8 (diff)
gpg4libre: When encrypting, show all available GPG keys
(not only private ones) Change-Id: I3fd248f4cace1ea248267d5696da9cb70940744e Reviewed-on: https://gerrit.libreoffice.org/41508 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'xmlsecurity/source/gpg/SecurityEnvironment.cxx')
-rw-r--r--xmlsecurity/source/gpg/SecurityEnvironment.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.cxx b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
index 367fa35e76a3..c3cd90565fe2 100644
--- a/xmlsecurity/source/gpg/SecurityEnvironment.cxx
+++ b/xmlsecurity/source/gpg/SecurityEnvironment.cxx
@@ -64,14 +64,14 @@ OUString SecurityEnvironmentGpg::getSecurityEnvironmentInformation()
return OUString();
}
-Sequence< Reference < XCertificate > > SecurityEnvironmentGpg::getPersonalCertificates()
+Sequence< Reference < XCertificate > > SecurityEnvironmentGpg::getCertificatesImpl( bool bPrivateOnly )
{
CertificateImpl* xCert;
std::list< GpgME::Key > keyList;
std::list< CertificateImpl* > certsList;
m_ctx->setKeyListMode(GPGME_KEYLIST_MODE_LOCAL);
- GpgME::Error err = m_ctx->startKeyListing("", true);
+ GpgME::Error err = m_ctx->startKeyListing("", bPrivateOnly );
while (!err) {
GpgME::Key k = m_ctx->nextKey(err);
if (err)
@@ -99,6 +99,16 @@ Sequence< Reference < XCertificate > > SecurityEnvironmentGpg::getPersonalCertif
return xCertificateSequence;
}
+Sequence< Reference < XCertificate > > SecurityEnvironmentGpg::getPersonalCertificates()
+{
+ return getCertificatesImpl( true );
+}
+
+Sequence< Reference < XCertificate > > SecurityEnvironmentGpg::getAllCertificates()
+{
+ return getCertificatesImpl( false );
+}
+
Reference< XCertificate > SecurityEnvironmentGpg::getCertificate( const OUString& keyId, const Sequence< sal_Int8 >& /*serialNumber*/ )
{
CertificateImpl* xCert=nullptr;