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 INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_ENCRYPTIONENGINE_HXX
21 #define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_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 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{
36 class XComponentContext
;
39 class EncryptionEngine
: public cppu::ImplInheritanceHelper1
42 com::sun::star::xml::crypto::sax::XBlockerMonitor
44 /****** encryptionEngine.hxx/CLASS encryptionEngine ***************************
47 * EncryptionEngine -- Base class of Encryptor and Decryptor
50 * Maintains common members and methods related with encryption.
54 * Email: michael.mi@sun.com
55 ******************************************************************************/
58 com::sun::star::uno::Reference
<
59 com::sun::star::uno::XComponentContext
> m_xContext
;
63 * the Encryption bridge component, which performs encrypt and decrypt
64 * operation based on xmlsec library.
66 com::sun::star::uno::Reference
<
67 com::sun::star::xml::crypto::XXMLEncryption
> m_xXMLEncryption
;
70 * the Id of template blocker.
72 sal_Int32 m_nIdOfBlocker
;
75 EncryptionEngine( const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
> & xContext
);
76 virtual ~EncryptionEngine(){};
78 virtual void tryToPerform( )
79 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
) SAL_OVERRIDE
;
80 virtual void clearUp( ) const SAL_OVERRIDE
;
81 virtual bool checkReady() const SAL_OVERRIDE
;
84 * starts the main function. This method will be implemented by any sub-class.
85 * For a Encryptor, it performs encryption operation;
86 * for a Decryptor, decryption operation is performed.
88 virtual void startEngine( const com::sun::star::uno::Reference
<
89 com::sun::star::xml::crypto::XXMLEncryptionTemplate
>&)
90 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
)
95 virtual void SAL_CALL
setBlockerId( sal_Int32 id
)
96 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */