summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-03-29 12:28:15 +0000
committerRüdiger Timm <rt@openoffice.org>2005-03-29 12:28:15 +0000
commit5894eabd629289745e38c35e6f5540ff4f3545f2 (patch)
tree6b44d9a9223376887009f00cff857757b9755f7d /xmlsecurity
parent1ebb606fccf2ef473613a18a5034c8018f611e05 (diff)
INTEGRATION: CWS xmlsec10 (1.7.24); FILE MERGED
2005/03/23 09:52:56 mmi 1.7.24.4: idl review Issue number: Submitted by: Reviewed by: 2005/03/21 07:04:39 mmi 1.7.24.3: add testing code for profile detection Issue number: Submitted by: Reviewed by: 2005/03/16 07:31:43 mt 1.7.24.2: RESYNC: (1.7-1.8); FILE MERGED 2005/03/08 08:26:21 mmi 1.7.24.1: add key usage information Issue number: Submitted by: Reviewed by:
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/tools/demo/util.cxx52
1 files changed, 48 insertions, 4 deletions
diff --git a/xmlsecurity/tools/demo/util.cxx b/xmlsecurity/tools/demo/util.cxx
index ae607abd049d..1010aa507c3a 100644
--- a/xmlsecurity/tools/demo/util.cxx
+++ b/xmlsecurity/tools/demo/util.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: util.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: vg $ $Date: 2005-03-10 18:15:29 $
+ * last change: $Author: rt $ $Date: 2005-03-29 13:28:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,8 +62,10 @@
#include "util.hxx"
#include <com/sun/star/registry/XImplementationRegistration.hpp>
+#include <com/sun/star/security/KeyUsage.hpp>
#include <cppuhelper/bootstrap.hxx>
#include <xmlsecurity/biginteger.hxx>
+#include <comphelper/processfactory.hxx>
#include <rtl/ustrbuf.hxx>
@@ -176,7 +178,11 @@ cssu::Reference< cssl::XMultiServiceFactory > serviceManager(
"Cannot create intial service manager" ) ;
xContext = xLocalComponentContext ;
- return cssu::Reference< cssl::XMultiServiceFactory >(xLocalServiceManager, cssu::UNO_QUERY) ;
+ cssu::Reference< cssl::XMultiServiceFactory > xManager = cssu::Reference< cssl::XMultiServiceFactory >(xLocalServiceManager, cssu::UNO_QUERY) ;
+
+ ::comphelper::setProcessServiceFactory( xManager );
+
+ return xManager;
}
::rtl::OUString getSignatureInformation(
@@ -352,7 +358,45 @@ cssu::Reference< cssl::XMultiServiceFactory > serviceManager(
result += rtl::OUString::createFromAscii( "\n <<\n" );
}
- result += rtl::OUString::createFromAscii( "\n" );
+ result += rtl::OUString::createFromAscii( "\n Key Usage : " );
+ sal_Int32 usage = xCert->getCertificateUsage();
+
+ if (usage & ::com::sun::star::security::KeyUsage::DIGITAL_SIGNATURE)
+ {
+ result += rtl::OUString::createFromAscii( "DIGITAL_SIGNATURE " );
+ }
+
+ if (usage & ::com::sun::star::security::KeyUsage::NON_REPUDIATION)
+ {
+ result += rtl::OUString::createFromAscii( "NON_REPUDIATION " );
+ }
+
+ if (usage & ::com::sun::star::security::KeyUsage::KEY_ENCIPHERMENT)
+ {
+ result += rtl::OUString::createFromAscii( "KEY_ENCIPHERMENT " );
+ }
+
+ if (usage & ::com::sun::star::security::KeyUsage::DATA_ENCIPHERMENT)
+ {
+ result += rtl::OUString::createFromAscii( "DATA_ENCIPHERMENT " );
+ }
+
+ if (usage & ::com::sun::star::security::KeyUsage::KEY_AGREEMENT)
+ {
+ result += rtl::OUString::createFromAscii( "KEY_AGREEMENT " );
+ }
+
+ if (usage & ::com::sun::star::security::KeyUsage::KEY_CERT_SIGN)
+ {
+ result += rtl::OUString::createFromAscii( "KEY_CERT_SIGN " );
+ }
+
+ if (usage & ::com::sun::star::security::KeyUsage::CRL_SIGN)
+ {
+ result += rtl::OUString::createFromAscii( "CRL_SIGN " );
+ }
+
+ result += rtl::OUString::createFromAscii( "\n" );
}
result += rtl::OUString::createFromAscii( "\n" );