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_nssimpl.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_NSSIMPL_HXX_
32 #define _XMLSIGNATURECONTEXT_NSSIMPL_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 #ifndef INCLUDED_VECTOR
55 #define INCLUDED_VECTOR
58 class XMLSecurityContext_NssImpl
: public ::cppu::WeakImplHelper3
<
59 ::com::sun::star::xml::crypto::XXMLSecurityContext
,
60 ::com::sun::star::lang::XInitialization
,
61 ::com::sun::star::lang::XServiceInfo
>
64 //xmlSecKeysMngrPtr m_pKeysMngr ;
65 //::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment ;
66 std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
> > m_vSecurityEnvironments
;
68 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xServiceManager
;
70 sal_Int32 m_nDefaultEnvIndex
;
73 XMLSecurityContext_NssImpl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& aFactory
) ;
74 virtual ~XMLSecurityContext_NssImpl() ;
76 //Methods from XXMLSecurityContext
77 virtual sal_Int32 SAL_CALL
addSecurityEnvironment(
78 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
>& aSecurityEnvironment
79 ) throw (::com::sun::star::security::SecurityInfrastructureException
, ::com::sun::star::uno::RuntimeException
);
81 virtual ::sal_Int32 SAL_CALL
getSecurityEnvironmentNumber( )
82 throw (::com::sun::star::uno::RuntimeException
);
84 virtual ::com::sun::star::uno::Reference
<
85 ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
86 getSecurityEnvironmentByIndex( ::sal_Int32 index
)
87 throw (::com::sun::star::uno::RuntimeException
);
89 virtual ::com::sun::star::uno::Reference
<
90 ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
91 getSecurityEnvironment( )
92 throw (::com::sun::star::uno::RuntimeException
);
94 virtual ::sal_Int32 SAL_CALL
getDefaultSecurityEnvironmentIndex( )
95 throw (::com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex
)
98 throw (::com::sun::star::uno::RuntimeException
);
100 //Methods from XInitialization
101 virtual void SAL_CALL
initialize(
102 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
103 ) throw( ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
105 //Methods from XServiceInfo
106 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
108 virtual sal_Bool SAL_CALL
supportsService(
109 const ::rtl::OUString
& ServiceName
110 ) throw( ::com::sun::star::uno::RuntimeException
) ;
112 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
) ;
114 //Helper for XServiceInfo
115 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> impl_getSupportedServiceNames() ;
117 static ::rtl::OUString
impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
119 //Helper for registry
120 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
) ;
122 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
) ;
125 * Because of the issue of multi-securityenvironment, so the keyManager method is not useful any longer.
128 //Methods from XUnoTunnel
129 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
130 throw (com::sun::star::uno::RuntimeException);
132 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
133 static XMLSecurityContext_NssImpl* 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 ) ;
141 #endif // _XMLSIGNATURECONTEXT_NSSIMPL_HXX_