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 _ENCRYPTIONENGINE_HXX
21 #define _ENCRYPTIONENGINE_HXX
23 #include <com/sun/star/xml/crypto/sax/XReferenceResolvedListener.hpp>
24 #include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp>
25 #include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp>
26 #include <com/sun/star/xml/crypto/sax/XKeyCollector.hpp>
27 #include <com/sun/star/xml/crypto/sax/XMissionTaker.hpp>
28 #include <com/sun/star/xml/crypto/sax/XSAXEventKeeper.hpp>
29 #include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
30 #include <com/sun/star/xml/crypto/XXMLEncryption.hpp>
31 #include <cppuhelper/implbase1.hxx>
33 #include "securityengine.hxx"
35 class EncryptionEngine
: public cppu::ImplInheritanceHelper1
38 com::sun::star::xml::crypto::sax::XBlockerMonitor
40 /****** encryptionEngine.hxx/CLASS encryptionEngine ***************************
43 * EncryptionEngine -- Base class of Encryptor and Decryptor
46 * Maintains common members and methods related with encryption.
50 * Email: michael.mi@sun.com
51 ******************************************************************************/
55 * the Encryption bridge component, which performs encrypt and decrypt
56 * operation based on xmlsec library.
58 com::sun::star::uno::Reference
<
59 com::sun::star::xml::crypto::XXMLEncryption
> m_xXMLEncryption
;
62 * the Id of template blocker.
64 sal_Int32 m_nIdOfBlocker
;
68 virtual ~EncryptionEngine(){};
70 virtual void tryToPerform( )
71 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
72 virtual void clearUp( ) const;
73 virtual bool checkReady() const;
76 * starts the main function. This method will be implemented by any sub-class.
77 * For a Encryptor, it performs encryption operation;
78 * for a Decryptor, decryption operation is performed.
80 virtual void startEngine( const com::sun::star::uno::Reference
<
81 com::sun::star::xml::crypto::XXMLEncryptionTemplate
>&)
82 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
)
87 virtual void SAL_CALL
setBlockerId( sal_Int32 id
)
88 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */