summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-05-20 14:12:30 +0300
committerTor Lillqvist <tml@collabora.com>2016-05-20 15:20:28 +0300
commitc42be58e4c006ab3e1f262b644789cba8659d0ab (patch)
tree343ced02d1bd8e6794f27546062452c1a6b706ae /xmlsecurity
parent2be281097fc0531a6a18835119ab406dfb8494d2 (diff)
Show the certificate use also in the View Certificate dialog
Change-Id: I25ba55456be62307348eec529bfd434f8a90bac4
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificatechooser.hxx2
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx6
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.src5
-rw-r--r--xmlsecurity/source/dialogs/dialogs.hrc1
4 files changed, 13 insertions, 1 deletions
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 <xmlsecurity/certificatechooser.hxx>
#include <xmlsecurity/certificateviewer.hxx>
#include <com/sun/star/security/XCertificate.hpp>
@@ -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<CertificateChooser*>(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