Kaydet (Commit) c42be58e authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Show the certificate use also in the View Certificate dialog

Change-Id: I25ba55456be62307348eec529bfd434f8a90bac4
üst 2be28109
...@@ -64,7 +64,6 @@ private: ...@@ -64,7 +64,6 @@ private:
void ImplInitialize(); void ImplInitialize();
void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name); void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name);
OUString UsageInClearText(int bits);
public: public:
CertificateChooser(vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment); CertificateChooser(vcl::Window* pParent, css::uno::Reference< css::uno::XComponentContext>& rxCtx, css::uno::Reference< css::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment);
...@@ -77,6 +76,7 @@ public: ...@@ -77,6 +76,7 @@ public:
/// Gets the description string provided when selecting the certificate. /// Gets the description string provided when selecting the certificate.
OUString GetDescription(); OUString GetDescription();
OUString UsageInClearText(int bits);
}; };
#endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATECHOOSER_HXX #endif // INCLUDED_XMLSECURITY_INC_XMLSECURITY_CERTIFICATECHOOSER_HXX
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <xmlsecurity/certificatechooser.hxx>
#include <xmlsecurity/certificateviewer.hxx> #include <xmlsecurity/certificateviewer.hxx>
#include <com/sun/star/security/XCertificate.hpp> #include <com/sun/star/security/XCertificate.hpp>
...@@ -278,6 +279,11 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C ...@@ -278,6 +279,11 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C
aLBEntry = aDetails = xCert->getSignatureAlgorithm(); aLBEntry = aDetails = xCert->getSignatureAlgorithm();
InsertElement( XMLSEC_RES( STR_SIGNATURE_ALGO ), aLBEntry, aDetails ); 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(); aSeq = xCert->getSHA1Thumbprint();
aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep );
aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak ); aDetails = XmlSec::GetHexString( aSeq, pHexSep, nLineBreak );
......
...@@ -86,6 +86,11 @@ String STR_SIGNATURE_ALGO ...@@ -86,6 +86,11 @@ String STR_SIGNATURE_ALGO
Text [ en-US ] = "Signature Algorithm"; Text [ en-US ] = "Signature Algorithm";
}; };
String STR_USE
{
Text [ en-US ] = "Certificate Use";
};
String STR_THUMBPRINT_SHA1 String STR_THUMBPRINT_SHA1
{ {
Text [ en-US ] = "Thumbprint SHA1"; Text [ en-US ] = "Thumbprint SHA1";
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#define STR_SIGNATURE_ALGO 266 #define STR_SIGNATURE_ALGO 266
#define STR_THUMBPRINT_SHA1 267 #define STR_THUMBPRINT_SHA1 267
#define STR_THUMBPRINT_MD5 268 #define STR_THUMBPRINT_MD5 268
#define STR_USE 271
// --------- general metrics --------- // --------- general metrics ---------
#define DLGS_WIDTH 287 #define DLGS_WIDTH 287
......
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