xref: /AOO41X/main/xmlsecurity/source/xmlsec/mscrypt/xmlsecuritycontext_mscryptimpl.hxx (revision ec61c6ed669d81c7df08233ccc38d0040f129ece)
1*ec61c6edSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*ec61c6edSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*ec61c6edSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*ec61c6edSAndrew Rist  * distributed with this work for additional information
6*ec61c6edSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*ec61c6edSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*ec61c6edSAndrew Rist  * "License"); you may not use this file except in compliance
9*ec61c6edSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*ec61c6edSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*ec61c6edSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*ec61c6edSAndrew Rist  * software distributed under the License is distributed on an
15*ec61c6edSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ec61c6edSAndrew Rist  * KIND, either express or implied.  See the License for the
17*ec61c6edSAndrew Rist  * specific language governing permissions and limitations
18*ec61c6edSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*ec61c6edSAndrew Rist  *************************************************************/
21*ec61c6edSAndrew Rist 
22*ec61c6edSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
25cdf0e10cSrcweir #define _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <sal/config.h>
28cdf0e10cSrcweir #include <rtl/ustring.hxx>
29cdf0e10cSrcweir #include <cppuhelper/factory.hxx>
30cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx>
31cdf0e10cSrcweir #include <com/sun/star/uno/Exception.hpp>
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
34cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include <com/sun/star/lang/XSingleServiceFactory.hpp>
37cdf0e10cSrcweir 
38cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_
39cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #include <com/sun/star/lang/XInitialization.hpp>
42cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp>
43cdf0e10cSrcweir #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
44cdf0e10cSrcweir #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
45cdf0e10cSrcweir 
46cdf0e10cSrcweir //#include "xmlsec/xmlsec.h"
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class XMLSecurityContext_MSCryptImpl : public ::cppu::WeakImplHelper3<
49cdf0e10cSrcweir 	::com::sun::star::xml::crypto::XXMLSecurityContext ,
50cdf0e10cSrcweir 	::com::sun::star::lang::XInitialization ,
51cdf0e10cSrcweir 	::com::sun::star::lang::XServiceInfo >
52cdf0e10cSrcweir {
53cdf0e10cSrcweir 	private :
54cdf0e10cSrcweir 		//xmlSecKeysMngrPtr m_pKeysMngr ;
55cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment ;
56cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager ;
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	public :
59cdf0e10cSrcweir 		XMLSecurityContext_MSCryptImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& aFactory ) ;
60cdf0e10cSrcweir 		virtual ~XMLSecurityContext_MSCryptImpl() ;
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 		//Methods from XXMLSecurityContext
63cdf0e10cSrcweir 		virtual sal_Int32 SAL_CALL addSecurityEnvironment(
64cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment
65cdf0e10cSrcweir 			) throw (::com::sun::star::security::SecurityInfrastructureException, ::com::sun::star::uno::RuntimeException);
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 		virtual ::sal_Int32 SAL_CALL getSecurityEnvironmentNumber(  )
68cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference<
71cdf0e10cSrcweir 			::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
72cdf0e10cSrcweir 			getSecurityEnvironmentByIndex( ::sal_Int32 index )
73cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference<
76cdf0e10cSrcweir 			::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL
77cdf0e10cSrcweir 			getSecurityEnvironment(  )
78cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 		virtual ::sal_Int32 SAL_CALL getDefaultSecurityEnvironmentIndex(  )
81cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir 		virtual void SAL_CALL setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex )
84cdf0e10cSrcweir 			throw (::com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir 
86cdf0e10cSrcweir #if 0
87cdf0e10cSrcweir 		virtual void SAL_CALL setSecurityEnvironment(
88cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment >& aSecurityEnvironment
89cdf0e10cSrcweir 		) throw( com::sun::star::security::SecurityInfrastructureException) ;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > SAL_CALL getSecurityEnvironment()
92cdf0e10cSrcweir 			throw(::com::sun::star::uno::RuntimeException);
93cdf0e10cSrcweir #endif
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 		//Methods from XInitialization
96cdf0e10cSrcweir 		virtual void SAL_CALL initialize(
97cdf0e10cSrcweir 			const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments
98cdf0e10cSrcweir 		) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 		//Methods from XServiceInfo
101cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL supportsService(
104cdf0e10cSrcweir 			const ::rtl::OUString& ServiceName
105cdf0e10cSrcweir 		) throw( ::com::sun::star::uno::RuntimeException ) ;
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ) ;
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 		//Helper for XServiceInfo
110cdf0e10cSrcweir 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > impl_getSupportedServiceNames() ;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 		static ::rtl::OUString impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException ) ;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 		//Helper for registry
115cdf0e10cSrcweir 		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 ) ;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 		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 ) ;
118cdf0e10cSrcweir 
119cdf0e10cSrcweir #if 0
120cdf0e10cSrcweir 		//Methods from XUnoTunnel
121cdf0e10cSrcweir 		virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
122cdf0e10cSrcweir 		throw (com::sun::star::uno::RuntimeException);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 		static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
125cdf0e10cSrcweir 		static XMLSecurityContext_MSCryptImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ;
126cdf0e10cSrcweir #endif
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 		//Native mehtods
129cdf0e10cSrcweir 		//virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
130cdf0e10cSrcweir } ;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir #endif	// _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
133cdf0e10cSrcweir 
134