diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-07-10 10:02:10 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-07-10 15:41:44 +0200 |
commit | 820bd4b3b64a5746599c48c729037a959ff61c84 (patch) | |
tree | 720e47094e0981b6fbcacdea5b963c92d3210e52 /xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | |
parent | c86be45d343635f2e137b8ea710d87e1a612101d (diff) |
tdf#108977 Show signature info also for keys we don't have locally
gpg4libre
Change-Id: I89593224590007e61bce95c14922c08551282067
Reviewed-on: https://gerrit.libreoffice.org/39742
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 5cb148db7aa1..37d0608d66c7 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -537,7 +537,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; @@ -564,28 +563,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 ) |