1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #ifndef _XMLENCRYPTION_NSSIMPL_HXX_
29 #define _XMLENCRYPTION_NSSIMPL_HXX_
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>
37 #ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
38 #include <com/sun/star/uno/Reference.hxx>
40 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
42 #ifndef _COM_SUN_STAR_LANG_XSECVICEINFO_HPP_
43 #include <com/sun/star/lang/XServiceInfo.hpp>
45 #include <com/sun/star/lang/XInitialization.hpp>
46 #include <com/sun/star/xml/crypto/XXMLEncryption.hpp>
47 #include <com/sun/star/xml/crypto/XXMLEncryptionTemplate.hpp>
48 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
50 class XMLEncryption_NssImpl
: public ::cppu::WeakImplHelper3
<
51 ::com::sun::star::xml::crypto::XXMLEncryption
,
52 ::com::sun::star::lang::XInitialization
,
53 ::com::sun::star::lang::XServiceInfo
>
56 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xServiceManager
;
59 XMLEncryption_NssImpl( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& aFactory
) ;
60 virtual ~XMLEncryption_NssImpl() ;
62 //Methods from XXMLEncryption
63 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate
> SAL_CALL
encrypt(
64 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate
>& aTemplate
,
65 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XSecurityEnvironment
>& aEnvironment
)
66 // ) throw( ::com::sun::star::uno::Exception , ::com::sun::star::uno::RuntimeException ) ;
67 throw ( com::sun::star::xml::crypto::XMLEncryptionException
,
68 com::sun::star::uno::SecurityException
);
70 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate
> SAL_CALL
decrypt(
71 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XXMLEncryptionTemplate
>& aTemplate
,
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::xml::crypto::XXMLSecurityContext
>& aContext
73 ) throw( com::sun::star::xml::crypto::XMLEncryptionException
,
74 com::sun::star::uno::SecurityException
) ;
76 //Methods from XInitialization
77 virtual void SAL_CALL
initialize(
78 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
79 ) throw( ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
81 //Methods from XServiceInfo
82 virtual ::rtl::OUString SAL_CALL
getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
84 virtual sal_Bool SAL_CALL
supportsService(
85 const ::rtl::OUString
& ServiceName
86 ) throw( ::com::sun::star::uno::RuntimeException
) ;
88 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException
) ;
90 //Helper for XServiceInfo
91 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> impl_getSupportedServiceNames() ;
93 static ::rtl::OUString
impl_getImplementationName() throw( ::com::sun::star::uno::RuntimeException
) ;
96 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
) ;
98 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
) ;
101 #endif // _XMLENCRYPTION_NSSIMPL_HXX_