Kaydet (Commit) 72f84c1a authored tarafından Katarina Behrens's avatar Katarina Behrens Kaydeden (comit) Samuel Mehrbrodt

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/38984Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst 7b5fac67
......@@ -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);
......
......@@ -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() );
}
}
......
......@@ -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
......
......@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment