[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source xmlsecurity/uiconfig

Katarina Behrens Katarina.Behrens at cib.de
Fri Jun 23 07:13:37 UTC 2017


 xmlsecurity/inc/resourcemanager.hxx                |    2 ++
 xmlsecurity/source/dialogs/certificatechooser.cxx  |   10 ++++++----
 xmlsecurity/source/dialogs/resourcemanager.cxx     |   13 +++++++++++++
 xmlsecurity/uiconfig/ui/selectcertificatedialog.ui |   11 +++++++++++
 4 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 72f84c1a0efbce8da02cbf6d5947d2ddfd45c533
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue Jun 20 14:21:06 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

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 00911d180cbf..cb8d3e239cd7 100644
--- a/xmlsecurity/source/dialogs/resourcemanager.cxx
+++ b/xmlsecurity/source/dialogs/resourcemanager.cxx
@@ -67,6 +67,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">


More information about the Libreoffice-commits mailing list