1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
21 #define _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
23 #include <sal/config.h>
24 #include <rtl/ustring.hxx>
25 #include <cppuhelper/factory.hxx>
26 #include <cppuhelper/implbase3.hxx>
27 #include <com/sun/star/uno/Exception.hpp>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/lang/XUnoTunnel.hpp>
35 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
36 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
40 class XMLSecurityContext_NssImpl
: public ::cppu::WeakImplHelper3
<
41 ::com::sun::star::xml::crypto::XXMLSecurityContext
,
42 ::com::sun::star::lang::XInitialization
,
43 ::com::sun::star::lang::XServiceInfo
>
46 //xmlSecKeysMngrPtr m_pKeysMngr ;
47 //::com::sun::star::uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > m_xSecurityEnvironment ;
48 std::vector
< ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
> > m_vSecurityEnvironments
;
50 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xServiceManager
;
52 sal_Int32 m_nDefaultEnvIndex
;
55 XMLSecurityContext_NssImpl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& aFactory
) ;
56 virtual ~XMLSecurityContext_NssImpl() ;
58 //Methods from XXMLSecurityContext
59 virtual sal_Int32 SAL_CALL
addSecurityEnvironment(
60 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
>& aSecurityEnvironment
61 ) throw (::com::sun::star::security::SecurityInfrastructureException
, ::com::sun::star::uno::RuntimeException
);
63 virtual ::sal_Int32 SAL_CALL
getSecurityEnvironmentNumber( )
64 throw (::com::sun::star::uno::RuntimeException
);
66 virtual ::com::sun::star::uno::Reference
<
67 ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
68 getSecurityEnvironmentByIndex( ::sal_Int32 index
)
69 throw (::com::sun::star::uno::RuntimeException
);
71 virtual ::com::sun::star::uno::Reference
<
72 ::com::sun::star::xml::crypto::XSecurityEnvironment
> SAL_CALL
73 getSecurityEnvironment( )
74 throw (::com::sun::star::uno::RuntimeException
);
76 virtual ::sal_Int32 SAL_CALL
getDefaultSecurityEnvironmentIndex( )
77 throw (::com::sun::star::uno::RuntimeException
);
79 virtual void SAL_CALL
setDefaultSecurityEnvironmentIndex( sal_Int32 nDefaultEnvIndex
)
80 throw (::com::sun::star::uno::RuntimeException
);
82 //Methods from XInitialization
83 virtual void SAL_CALL
initialize(
84 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
85 ) throw( ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
87 //Methods from XServiceInfo
88 virtual OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
90 virtual sal_Bool SAL_CALL
supportsService(
91 const OUString
& ServiceName
92 ) throw( ::com::sun::star::uno::RuntimeException
) ;
94 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
) ;
96 //Helper for XServiceInfo
97 static ::com::sun::star::uno::Sequence
< OUString
> impl_getSupportedServiceNames() ;
99 static OUString
impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
101 //Helper for registry
102 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
) ;
104 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
) ;
107 * Because of the issue of multi-securityenvironment, so the keyManager method is not useful any longer.
110 //Methods from XUnoTunnel
111 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
112 throw (com::sun::star::uno::RuntimeException);
114 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId() ;
115 static XMLSecurityContext_NssImpl* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xObj ) ;
118 virtual xmlSecKeysMngrPtr keysManager() throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
123 #endif // _XMLSIGNATURECONTEXT_NSSIMPL_HXX_
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */