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: encryptionengine.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 _ENCRYPTIONENGINE_HXX
32 #define _ENCRYPTIONENGINE_HXX
34 #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
35 #include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp>
36 #include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp>
37 #include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp>
38 #include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp>
39 #include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp>
40 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
41 #include <com/sun/star/xml/crypto/XXMLEncryption.hpp>
42 #include <cppuhelper/implbase1.hxx>
44 #include "securityengine.hxx"
46 class EncryptionEngine
: public cppu::ImplInheritanceHelper1
49 com::sun::star::xml::crypto::sax::XBlockerMonitor
51 /****** encryptionEngine.hxx/CLASS encryptionEngine ***************************
54 * EncryptionEngine -- Base class of Encryptor and Decryptor
57 * Maintains common members and methods related with encryption.
60 * 05.01.2004 - Interface supported: XBlockerMonitor
64 * Email: michael.mi@sun.com
65 ******************************************************************************/
69 * the Encryption bridge component, which performs encrypt and decrypt
70 * operation based on xmlsec library.
72 com::sun::star::uno::Reference
<
73 com::sun::star::xml::crypto::XXMLEncryption
> m_xXMLEncryption
;
76 * the Id of template blocker.
78 sal_Int32 m_nIdOfBlocker
;
82 virtual ~EncryptionEngine(){};
84 virtual void tryToPerform( )
85 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
86 virtual void clearUp( ) const;
87 virtual bool checkReady() const;
90 * starts the main function. This method will be implemented by any sub-class.
91 * For a Encryptor, it performs encryption operation;
92 * for a Decryptor, decryption operation is performed.
94 virtual void startEngine( const com::sun::star::uno::Reference
<
95 com::sun::star::xml::crypto::XXMLEncryptionTemplate
>&)
96 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
)
100 /* XBlockerMonitor */
101 virtual void SAL_CALL
setBlockerId( sal_Int32 id
)
102 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);