1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
29 #define _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
30 
31 #include <sal/config.h>
32 #include <rtl/ustring.hxx>
33 #include <cppuhelper/factory.hxx>
34 #include <cppuhelper/implbase3.hxx>
35 #include <com/sun/star/uno/Exception.hpp>
36 
37 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
38 #include <com/sun/star/uno/Reference.hxx>
39 #endif
40 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
41 
42 #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_
43 #include <com/sun/star/lang/XServiceInfo.hpp>
44 #endif
45 #include <com/sun/star/lang/XInitialization.hpp>
46 #include <com/sun/star/lang/XUnoTunnel.hpp>
47 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
48 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
49 
50 #ifndef INCLUDED_VECTOR
51 #include <vector>
52 #define INCLUDED_VECTOR
53 #endif
54 
55 class XMLSecurityContext_NssImpl : public ::cppu::WeakImplHelper3<
56 	::com::sun::star::xml::crypto::XXMLSecurityContext ,
57 	::com::sun::star::lang::XInitialization ,
58 	::com::sun::star::lang::XServiceInfo >
59 {
60 	private :
61 		//xmlSecKeysMngrPtr m_pKeysMngr ;
62 		//::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment ;
63 		std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > > m_vSecurityEnvironments;
64 
65 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
66 
67 		sal_Int32 m_nDefaultEnvIndex;
68 
69 	public :
70 		XMLSecurityContext_NssImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
71 		virtual ~XMLSecurityContext_NssImpl() ;
72 
73 		//Methods from XXMLSecurityContext
74 		virtual sal_Int32 SAL_CALL addSecurityEnvironment(
75 			const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment
76 			) throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException);
77 
78 		virtual ::sal_Int32 SAL_CALL getSecurityEnvironmentNumber(  )
79 			throw (::com::sun::star::uno::RuntimeException);
80 
81 		virtual ::com::sun::star::uno::Reference<
82 			::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
83 			getSecurityEnvironmentByIndex( ::sal_Int32 index )
84 			throw (::com::sun::star::uno::RuntimeException);
85 
86 		virtual ::com::sun::star::uno::Reference<
87 			::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
88 			getSecurityEnvironment(  )
89 			throw (::com::sun::star::uno::RuntimeException);
90 
91 		virtual ::sal_Int32 SAL_CALL getDefaultSecurityEnvironmentIndex(  )
92 			throw (::com::sun::star::uno::RuntimeException);
93 
94 		virtual void SAL_CALL setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex )
95 			throw (::com::sun::star::uno::RuntimeException);
96 
97 		//Methods from XInitialization
98 		virtual void SAL_CALL initialize(
99 			const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments
100 		) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
101 
102 		//Methods from XServiceInfo
103 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
104 
105 		virtual sal_Bool SAL_CALL supportsService(
106 			const ::rtl::OUString& ServiceName
107 		) throw( ::com::sun::star::uno::RuntimeException ) ;
108 
109 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ;
110 
111 		//Helper for XServiceInfo
112 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ;
113 
114 		static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
115 
116 		//Helper for registry
117 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL impl_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) throw( ::com::sun::star::uno::RuntimeException ) ;
118 
119 		static ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > impl_createFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aServiceManager ) ;
120 
121 		/*
122 		 * Because of the issue of multi-securityenvironment, so the keyManager method is not useful any longer.
123 		 *
124 
125 		//Methods from XUnoTunnel
126 		virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
127 		throw (com::sun::star::uno::RuntimeException);
128 
129 		static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
130 		static XMLSecurityContext_NssImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ;
131 
132 		//Native mehtods
133 		virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
134 
135 		*/
136 } ;
137 
138 #endif	// _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
139 
140