ImagingTools Core SDK
CStaticEncryptionKeyProviderComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <icomp/CComponentBase.h>
7#include <imod/CModelUpdateBridge.h>
8#include <iprm/IIdParam.h>
9
10// ImtCore includes
11#include <imtcrypt/IEncryptionKeysProvider.h>
12
13
14namespace imtcrypt
15{
16
17
21class CStaticEncryptionKeyProviderComp: public icomp::CComponentBase, virtual public imtcrypt::IEncryptionKeysProvider
22{
23public:
24 typedef icomp::CComponentBase BaseClass;
25
26 I_BEGIN_COMPONENT(CStaticEncryptionKeyProviderComp);
27 I_REGISTER_INTERFACE(imtcrypt::IEncryptionKeysProvider);
28 I_ASSIGN(m_publicKeyCompPtr, "PublicKey", "Public key for RSA algorithm", false, "PublicKey");
29 I_ASSIGN(m_privateKeyCompPtr, "PrivateKey", "Private key for RSA algorithm", false, "PrivateKey");
30 I_ASSIGN(m_passwordCompPtr, "Password", "Password key for AES algorithm", false, "Password");
31 I_ASSIGN(m_initializationVectorCompPtr, "InitializationVector", "Initialization vector key for AES algorithm", false, "InitializationVector");
32 I_END_COMPONENT;
33
34 CStaticEncryptionKeyProviderComp();
35
36protected:
37 // reimplemented (IEncryptionKeysProvider)
38 virtual QByteArray GetEncryptionKey(KeyType type) const override;
39
40 // reimplemented (icomp::CComponentBase)
41 virtual void OnComponentCreated() override;
42 virtual void OnComponentDestroyed() override;
43
44private:
45 I_REF(iprm::IIdParam, m_publicKeyCompPtr);
46 I_REF(iprm::IIdParam, m_privateKeyCompPtr);
47 I_REF(iprm::IIdParam, m_passwordCompPtr);
48 I_REF(iprm::IIdParam, m_initializationVectorCompPtr);
49
50 imod::CModelUpdateBridge m_updateBridge;
51};
52
53
54} //namespace imtcrypt
55
56
Cryptography and Encryption Services Module.