summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2017-06-20 14:21:06 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2017-06-27 09:14:59 +0200
commit5119d81e41e9c7199d3f419e24cba81537edff55 (patch)
treed810e6bfa71c6d77823380e1bc1d1ec84d537e75 /xmlsecurity
parentbbd0d521677d9dfaaea100b3943e9912f582359c (diff)
gpg4libre: Show certificate kind OpenPGP vs. X509 as 1 table column
Shuffled the columns around a little bit Change-Id: Ib0a979458db680d712737ff997e1c3b4e4564f3f Reviewed-on: https://gerrit.libreoffice.org/38984 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 72f84c1a0efbce8da02cbf6d5947d2ddfd45c533) Reviewed-on: https://gerrit.libreoffice.org/39148 Reviewed-by: Sophie Gautier <gautier.sophie@gmail.com> Reviewed-by: Heiko Tietze <tietze.heiko@googlemail.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/resourcemanager.hxx2
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx10
-rw-r--r--xmlsecurity/source/dialogs/resourcemanager.cxx13
-rw-r--r--xmlsecurity/uiconfig/ui/selectcertificatedialog.ui11
4 files changed, 32 insertions, 4 deletions
diff --git a/xmlsecurity/inc/resourcemanager.hxx b/xmlsecurity/inc/resourcemanager.hxx
index ece7fba24fe2..659c65bc0431 100644
--- a/xmlsecurity/inc/resourcemanager.hxx
+++ b/xmlsecurity/inc/resourcemanager.hxx
@@ -22,6 +22,7 @@
#include <tools/resmgr.hxx>
#include <tools/datetime.hxx>
+#include <com/sun/star/security/CertificateKind.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/uno/Sequence.hxx>
@@ -39,6 +40,7 @@ namespace XmlSec
DateTime GetDateTime( const css::util::DateTime& _rDT );
OUString GetDateTimeString( const css::util::DateTime& _rDT );
OUString GetDateString( const css::util::DateTime& _rDT );
+ OUString GetCertificateKind( const css::security::CertificateKind& rKind );
std::vector< std::pair< OUString, OUString> >
parseDN(const OUString& rRawString);
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 726b4038aa96..cb9d2db4d4e5 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -52,10 +52,11 @@ CertificateChooser::CertificateChooser(vcl::Window* _pParent,
pSignatures->set_height_request(aControlSize.Height());
m_pCertLB = VclPtr<SvSimpleTable>::Create(*pSignatures);
- static long nTabs[] = { 4, 0, 20*nControlWidth/100, 40*nControlWidth/100, 80*nControlWidth/100 };
+ static long nTabs[] = { 5, 0, 20*nControlWidth/100, 50*nControlWidth/100, 60*nControlWidth/100, 70*nControlWidth/100 };
m_pCertLB->SetTabs( &nTabs[0] );
m_pCertLB->InsertHeaderEntry(get<FixedText>("issuedto")->GetText() + "\t" + get<FixedText>("issuedby")->GetText()
- + "\t" + get<FixedText>("usage")->GetText() + "\t" + get<FixedText>("expiration")->GetText());
+ + "\t" + get<FixedText>("type")->GetText() + "\t" + get<FixedText>("expiration")->GetText()
+ + "\t" + get<FixedText>("usage")->GetText());
m_pCertLB->SetSelectHdl( LINK( this, CertificateChooser, CertificateHighlightHdl ) );
m_pCertLB->SetDoubleClickHdl( LINK( this, CertificateChooser, CertificateSelectHdl ) );
m_pViewBtn->SetClickHdl( LINK( this, CertificateChooser, ViewButtonHdl ) );
@@ -189,8 +190,9 @@ void CertificateChooser::ImplInitialize()
mvUserData.push_back(userData);
SvTreeListEntry* pEntry = m_pCertLB->InsertEntry( XmlSec::GetContentPart( xCerts[ nC ]->getSubjectName() )
+ "\t" + XmlSec::GetContentPart( xCerts[ nC ]->getIssuerName() )
- + "\t" + UsageInClearText( xCerts[ nC ]->getCertificateUsage() )
- + "\t" + XmlSec::GetDateString( xCerts[ nC ]->getNotValidAfter() ) );
+ + "\t" + XmlSec::GetCertificateKind( xCerts[ nC ]->getCertificateKind() )
+ + "\t" + XmlSec::GetDateString( xCerts[ nC ]->getNotValidAfter() )
+ + "\t" + UsageInClearText( xCerts[ nC ]->getCertificateUsage() ) );
pEntry->SetUserData( userData.get() );
}
}
diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx
index e989af368b60..2f2e6596f720 100644
--- a/xmlsecurity/source/dialogs/resourcemanager.cxx
+++ b/xmlsecurity/source/dialogs/resourcemanager.cxx
@@ -68,6 +68,19 @@ namespace XmlSec
return GetLocaleData().getDate( GetDateTime( _rDT ) );
}
+ OUString GetCertificateKind( const css::security::CertificateKind &rKind )
+ {
+ switch (rKind)
+ {
+ case css::security::CertificateKind_X509:
+ return OUString("X.509");
+ case css::security::CertificateKind_OPENPGP:
+ return OUString("OpenPGP");
+ default:
+ return OUString();
+ }
+ }
+
/*
Creates two strings based on the distinguished name which are displayed in the
certificate details view. The first string contains only the values of the attribute
diff --git a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
index 0d9d60152cb6..57494738eda0 100644
--- a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
+++ b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
@@ -129,6 +129,17 @@
<property name="top_attach">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="type">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes">Type</property>
+ </object>
+ <packing>
+ <property name="left_attach">4</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
<!-- Just for localisation -->
<child>
<object class="GtkLabel" id="STR_DIGITAL_SIGNATURE">