1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlsecuritycontext_mscryptimpl.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
32 #define _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_
34 #include <sal/config.h>
35 #include <rtl/ustring.hxx>
36 #include <cppuhelper/factory.hxx>
37 #include <cppuhelper/implbase3.hxx>
38 #include <com/sun/star/uno/Exception.hpp>
40 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
41 #include <com/sun/star/uno/Reference.hxx>
43 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
45 #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_
46 #include <com/sun/star/lang/XServiceInfo.hpp>
48 #include <com/sun/star/lang/XInitialization.hpp>
49 #include <com/sun/star/lang/XUnoTunnel.hpp>
50 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
51 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
53 //#include "xmlsec/xmlsec.h"
55 class XMLSecurityContext_MSCryptImpl
: public ::cppu::WeakImplHelper3
<
56 ::com::sun::star::xml::crypto::XXMLSecurityContext
,
57 ::com::sun::star::lang::XInitialization
,
58 ::com::sun::star::lang::XServiceInfo
>
61 //xmlSecKeysMngrPtr m_pKeysMngr ;
62 ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
> m_xSecurityEnvironment
;
63 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xServiceManager
;
66 XMLSecurityContext_MSCryptImpl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& aFactory
) ;
67 virtual ~XMLSecurityContext_MSCryptImpl() ;
69 //Methods from XXMLSecurityContext
70 virtual sal_Int32 SAL_CALL
addSecurityEnvironment(
71 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
>& aSecurityEnvironment
72 ) throw (::com::sun::star::security::SecurityInfrastructureException
, ::com::sun::star::uno::RuntimeException
);
74 virtual ::sal_Int32 SAL_CALL
getSecurityEnvironmentNumber( )
75 throw (::com::sun::star::uno::RuntimeException
);
77 virtual ::com::sun::star::uno::Reference
<
78 ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
79 getSecurityEnvironmentByIndex( ::sal_Int32 index
)
80 throw (::com::sun::star::uno::RuntimeException
);
82 virtual ::com::sun::star::uno::Reference
<
83 ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
84 getSecurityEnvironment( )
85 throw (::com::sun::star::uno::RuntimeException
);
87 virtual ::sal_Int32 SAL_CALL
getDefaultSecurityEnvironmentIndex( )
88 throw (::com::sun::star::uno::RuntimeException
);
90 virtual void SAL_CALL
setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex
)
91 throw (::com::sun::star::uno::RuntimeException
);
94 virtual void SAL_CALL
setSecurityEnvironment(
95 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
>& aSecurityEnvironment
96 ) throw( com::sun::star::security::SecurityInfrastructureException
) ;
98 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
getSecurityEnvironment()
99 throw(::com::sun::star::uno::RuntimeException
);
102 //Methods from XInitialization
103 virtual void SAL_CALL
initialize(
104 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
105 ) throw( ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
107 //Methods from XServiceInfo
108 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
110 virtual sal_Bool SAL_CALL
supportsService(
111 const ::rtl::OUString
& ServiceName
112 ) throw( ::com::sun::star::uno::RuntimeException
) ;
114 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
) ;
116 //Helper for XServiceInfo
117 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> impl_getSupportedServiceNames() ;
119 static ::rtl::OUString
impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
121 //Helper for registry
122 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
) ;
124 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
) ;
127 //Methods from XUnoTunnel
128 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
)
129 throw (com::sun::star::uno::RuntimeException
);
131 static const ::com::sun::star::uno::Sequence
< sal_Int8
>& getUnoTunnelId() ;
132 static XMLSecurityContext_MSCryptImpl
* getImplementation( const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> xObj
) ;
136 //virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
139 #endif // _XMLSIGNATURECONTEXT_MSCRYPTIMPL_HXX_