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 _ENCRYPTORIMPL_HXX
21 #define _ENCRYPTORIMPL_HXX
23 #include <com/sun/star/xml/crypto/sax/XEncryptionResultBroadcaster.hpp>
24 #include <com/sun/star/xml/crypto/sax/XEncryptionResultListener.hpp>
25 #include <com/sun/star/xml/crypto/sax/XReferenceCollector.hpp>
26 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
27 #include <com/sun/star/lang/XInitialization.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <cppuhelper/implbase4.hxx>
31 #include "encryptionengine.hxx"
33 class EncryptorImpl
: public cppu::ImplInheritanceHelper4
36 com::sun::star::xml::crypto::sax::XEncryptionResultBroadcaster
,
37 com::sun::star::xml::crypto::sax::XReferenceCollector
,
38 com::sun::star::lang::XInitialization
,
39 com::sun::star::lang::XServiceInfo
41 /****** EncryptorImpl.hxx/CLASS EncryptorImpl *********************************
44 * EncryptorImpl -- generates an encryption
47 * Collects all resources for an encryption generation, then generates the
48 * encryption by invoking a xmlsec-based encryption bridge component.
52 * Email: michael.mi@sun.com
53 ******************************************************************************/
57 * the Id of the element to be encrypted.
59 sal_Int32 m_nReferenceId
;
61 com::sun::star::uno::Reference
<
62 com::sun::star::xml::crypto::XSecurityEnvironment
> m_xSecurityEnvironment
;
64 virtual void notifyResultListener() const
65 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
66 virtual bool checkReady() const;
67 virtual void startEngine( const com::sun::star::uno::Reference
<
68 com::sun::star::xml::crypto::XXMLEncryptionTemplate
>&
70 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
73 explicit EncryptorImpl( const com::sun::star::uno::Reference
<
74 com::sun::star::lang::XMultiServiceFactory
>& rxMSF
);
75 virtual ~EncryptorImpl();
77 /* XEncryptionResultBroadcaster */
78 virtual void SAL_CALL
addEncryptionResultListener(
79 const com::sun::star::uno::Reference
<
80 com::sun::star::xml::crypto::sax::XEncryptionResultListener
>&
82 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
83 virtual void SAL_CALL
removeEncryptionResultListener(
84 const com::sun::star::uno::Reference
<
85 com::sun::star::xml::crypto::sax::XEncryptionResultListener
>&
87 throw (com::sun::star::uno::RuntimeException
);
89 /* XReferenceCollector */
90 virtual void SAL_CALL
setReferenceCount( sal_Int32 count
)
91 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
93 virtual void SAL_CALL
setReferenceId( sal_Int32 id
)
94 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
97 virtual void SAL_CALL
initialize(
98 const com::sun::star::uno::Sequence
< com::sun::star::uno::Any
>& aArguments
)
99 throw (com::sun::star::uno::Exception
, com::sun::star::uno::RuntimeException
);
102 virtual rtl::OUString SAL_CALL
getImplementationName( )
103 throw (com::sun::star::uno::RuntimeException
);
104 virtual sal_Bool SAL_CALL
supportsService( const rtl::OUString
& ServiceName
)
105 throw (com::sun::star::uno::RuntimeException
);
106 virtual com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
getSupportedServiceNames( )
107 throw (com::sun::star::uno::RuntimeException
);
110 rtl::OUString
EncryptorImpl_getImplementationName()
111 throw ( com::sun::star::uno::RuntimeException
);
113 sal_Bool SAL_CALL
EncryptorImpl_supportsService( const rtl::OUString
& ServiceName
)
114 throw ( com::sun::star::uno::RuntimeException
);
116 com::sun::star::uno::Sequence
< rtl::OUString
> SAL_CALL
EncryptorImpl_getSupportedServiceNames( )
117 throw ( com::sun::star::uno::RuntimeException
);
119 com::sun::star::uno::Reference
< com::sun::star::uno::XInterface
>
120 SAL_CALL
EncryptorImpl_createInstance(
121 const com::sun::star::uno::Reference
< com::sun::star::lang::XMultiServiceFactory
>& rSMgr
)
122 throw ( com::sun::star::uno::Exception
);
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */