summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-07-10 10:02:10 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-13 15:51:22 +0200
commit25e0fef51557d2c93cf287dfb4721bb4c0086107 (patch)
tree3cd929d48b56e940b7c5bc8c3679979e2195b7ae /xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
parentfd4e25d226fcf8350165ae8c67779cb620bfbf5c (diff)
tdf#108977 Show signature info for keys we don't have locally
gpg4libre Reviewed-on: https://gerrit.libreoffice.org/39742 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 820bd4b3b64a5746599c48c729037a959ff61c84) Change-Id: I89593224590007e61bce95c14922c08551282067 Reviewed-on: https://gerrit.libreoffice.org/39793 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx')
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx47
1 files changed, 26 insertions, 21 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 6df31eec715f..22154dc4b2a3 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -532,7 +532,6 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
const SignatureInformation& rInfo = maSignatureManager.maCurrentSignatureInformations[n];
uno::Reference< css::security::XCertificate > xCert = getCertificate(rInfo);
- // TODO - should use pgpdata from info provider?
OUString aSubject;
OUString aIssuer;
OUString aDateTimeStr;
@@ -559,28 +558,34 @@ void DigitalSignaturesDialog::ImplFillSignaturesBox()
aSubject = XmlSec::GetContentPart( xCert->getSubjectName() );
aIssuer = XmlSec::GetContentPart( xCert->getIssuerName() );
- // String with date and time information (#i20172#)
- aDateTimeStr = XmlSec::GetDateTimeString( rInfo.stDateTime );
- aDescription = rInfo.ouDescription;
-
- // Decide type string.
- if (maSignatureManager.mxStore.is())
- {
- // XML based: XAdES or not.
- if (!rInfo.ouCertDigest.isEmpty())
- aType = "XAdES";
- else
- aType = "XML-DSig";
- }
+ }
+ else if (!rInfo.ouGpgCertificate.isEmpty())
+ {
+ // In case we don't have the gpg key locally, get some data from the document
+ aIssuer = rInfo.ouGpgOwner;
+ }
+
+ aDateTimeStr = XmlSec::GetDateTimeString( rInfo.stDateTime );
+ aDescription = rInfo.ouDescription;
+
+ // Decide type string.
+ if (maSignatureManager.mxStore.is())
+ {
+ // XML based: XAdES or not.
+ if (!rInfo.ouCertDigest.isEmpty())
+ aType = "XAdES";
else
- {
- // Assume PDF: PAdES or not.
- if (rInfo.bHasSigningCertificate)
- aType = "PAdES";
- else
- aType = "PDF";
- }
+ aType = "XML-DSig";
}
+ else
+ {
+ // Assume PDF: PAdES or not.
+ if (rInfo.bHasSigningCertificate)
+ aType = "PAdES";
+ else
+ aType = "PDF";
+ }
+
bSigValid = ( rInfo.nStatus == css::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED );
if ( bSigValid )