From c42be58e4c006ab3e1f262b644789cba8659d0ab Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 20 May 2016 14:12:30 +0300 Subject: Show the certificate use also in the View Certificate dialog Change-Id: I25ba55456be62307348eec529bfd434f8a90bac4 --- xmlsecurity/inc/xmlsecurity/certificatechooser.hxx | 2 +- xmlsecurity/source/dialogs/certificateviewer.cxx | 6 ++++++ xmlsecurity/source/dialogs/certificateviewer.src | 5 +++++ xmlsecurity/source/dialogs/dialogs.hrc | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx index 8617d058cc3d..e24c457bfc81 100644 --- a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx +++ b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx @@ -64,7 +64,6 @@ private: void ImplInitialize(); void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name); - OUString UsageInClearText(int bits); public: CertificateChooser(vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); @@ -77,6 +76,7 @@ public: /// Gets the description string provided when selecting the certificate. OUString GetDescription(); + OUString UsageInClearText(int bits); }; #endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATECHOOSER_HXX diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 21584b8d9d35..9c4e39767f87 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include @@ -278,6 +279,11 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C aLBEntry = aDetails = xCert->getSignatureAlgorithm(); InsertElement( XMLSEC_RES( STR_SIGNATURE_ALGO ), aLBEntry, aDetails ); + CertificateChooser* pChooser = dynamic_cast(mpDlg->GetParent()); + assert(pChooser); + aLBEntry = pChooser->UsageInClearText( mpDlg->mxCert->getCertificateUsage() ); + InsertElement( XMLSEC_RES( STR_USE ), aLBEntry, aLBEntry ); + aSeq = xCert->getSHA1Thumbprint(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); diff --git a/xmlsecurity/source/dialogs/certificateviewer.src b/xmlsecurity/source/dialogs/certificateviewer.src index 24e82463ac22..a62c50d72033 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.src +++ b/xmlsecurity/source/dialogs/certificateviewer.src @@ -86,6 +86,11 @@ String STR_SIGNATURE_ALGO Text [ en-US ] = "Signature Algorithm"; }; +String STR_USE +{ + Text [ en-US ] = "Certificate Use"; +}; + String STR_THUMBPRINT_SHA1 { Text [ en-US ] = "Thumbprint SHA1"; diff --git a/xmlsecurity/source/dialogs/dialogs.hrc b/xmlsecurity/source/dialogs/dialogs.hrc index af7b2069c40e..65cceb6085d2 100644 --- a/xmlsecurity/source/dialogs/dialogs.hrc +++ b/xmlsecurity/source/dialogs/dialogs.hrc @@ -38,6 +38,7 @@ #define STR_SIGNATURE_ALGO 266 #define STR_THUMBPRINT_SHA1 267 #define STR_THUMBPRINT_MD5 268 +#define STR_USE 271 // --------- general metrics --------- #define DLGS_WIDTH 287 -- cgit