merged tag ooo/OOO330_m14
[LibreOffice.git] / xmlsecurity / source / framework / decryptorimpl.hxx
blob99aa2822667cd0267bd47bbd8b60d2e0c75776c4
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 _DECRYPTORIMPL_HXX
29 #define _DECRYPTORIMPL_HXX
31 #include <com/sun/star/xml/crypto/sax/XDecryptionResultBroadcaster.hpp>
32 #include <com/sun/star/xml/crypto/sax/XDecryptionResultListener.hpp>
33 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
34 #include <com/sun/star/lang/XInitialization.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <cppuhelper/implbase3.hxx>
38 #include "encryptionengine.hxx"
40 class DecryptorImpl : public cppu::ImplInheritanceHelper3
42 EncryptionEngine,
43 com::sun::star::xml::crypto::sax::XDecryptionResultBroadcaster,
44 com::sun::star::lang::XInitialization,
45 com::sun::star::lang::XServiceInfo
47 /****** DecryptorImpl.hxx/CLASS DecryptorImpl *********************************
49 * NAME
50 * DecryptorImpl -- decrypts an encryption
52 * FUNCTION
53 * Collects all resources for decrypting an encryption, then decrypts the
54 * encryption by invoking a xmlsec-based encryption bridge component.
56 * HISTORY
57 * 05.01.2004 - Interface supported: XDecryptionResultBroadcaster,
58 * XInitialization, XServiceInfo
60 * AUTHOR
61 * Michael Mi
62 * Email: michael.mi@sun.com
63 ******************************************************************************/
65 private:
67 * the Id of the encryption, which is used for the result listener to
68 * identify the encryption.
70 sal_Int32 m_nEncryptionId;
73 * the decryption result,
74 * remembers whether the decryption succeeds.
76 bool m_bDecryptionSucceed;
78 com::sun::star::uno::Reference<
79 com::sun::star::xml::crypto::XXMLSecurityContext > m_xXMLSecurityContext;
81 virtual void notifyResultListener() const
82 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
83 virtual bool checkReady() const;
84 virtual void startEngine( const com::sun::star::uno::Reference<
85 com::sun::star::xml::crypto::XXMLEncryptionTemplate >&
86 xEncryptionTemplate)
87 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
89 public:
90 explicit DecryptorImpl( const com::sun::star::uno::Reference<
91 com::sun::star::lang::XMultiServiceFactory >& rxMSF);
92 virtual ~DecryptorImpl();
94 /* XDecryptionResultBroadcaster */
95 virtual void SAL_CALL addDecryptionResultListener(
96 const com::sun::star::uno::Reference<
97 com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
98 listener )
99 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
100 virtual void SAL_CALL removeDecryptionResultListener(
101 const com::sun::star::uno::Reference<
102 com::sun::star::xml::crypto::sax::XDecryptionResultListener >&
103 listener )
104 throw (com::sun::star::uno::RuntimeException);
106 /* XInitialization */
107 virtual void SAL_CALL initialize(
108 const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
109 throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException);
111 /* XServiceInfo */
112 virtual rtl::OUString SAL_CALL getImplementationName( )
113 throw (com::sun::star::uno::RuntimeException);
114 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName )
115 throw (com::sun::star::uno::RuntimeException);
116 virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames( )
117 throw (com::sun::star::uno::RuntimeException);
120 rtl::OUString DecryptorImpl_getImplementationName()
121 throw ( com::sun::star::uno::RuntimeException );
123 sal_Bool SAL_CALL DecryptorImpl_supportsService( const rtl::OUString& ServiceName )
124 throw ( com::sun::star::uno::RuntimeException );
126 com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( )
127 throw ( com::sun::star::uno::RuntimeException );
129 com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
130 SAL_CALL DecryptorImpl_createInstance(
131 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >&
132 rSMgr)
133 throw ( com::sun::star::uno::Exception );
135 #endif