sl@0: /* sl@0: * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __KEYAGREEMENTIMPL_H__ sl@0: #define __KEYAGREEMENTIMPL_H__ sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: sl@0: #include sl@0: #include sl@0: #include "keys.h" sl@0: #include "keyagreementplugin.h" sl@0: sl@0: /** sl@0: * Abstract base class for key agreement plug-ins. sl@0: */ sl@0: namespace SoftwareCrypto sl@0: { sl@0: using namespace CryptoSpi; sl@0: sl@0: NONSHARABLE_CLASS(CKeyAgreementImpl) : public CBase, public MKeyAgreement sl@0: { sl@0: public: sl@0: sl@0: // Override MPlugin virtual functions sl@0: void Close(); sl@0: void Reset(); // Always call reset in super-class if you override this sl@0: TAny* GetExtension(TUid aExtensionId); sl@0: void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics); sl@0: // End of MPlugin sl@0: sl@0: // Override MKeyAgreement virtual functions sl@0: void SetKeyL(const CKey& aSelfPrivateKey, const CCryptoParams* aParams); sl@0: // End of MKeyAgreement sl@0: sl@0: /// Destructor sl@0: ~CKeyAgreementImpl(); sl@0: sl@0: protected: sl@0: /** sl@0: Constructor sl@0: */ sl@0: CKeyAgreementImpl(); sl@0: sl@0: /** sl@0: Second phase of construction. Always call ConstructL in the super-class sl@0: if your override this method. sl@0: @param aPrivateKey The private key of one of the parties sl@0: @param aParams The parameters shared between both parties sl@0: */ sl@0: virtual void ConstructL(const CKey& aPrivateKey, const CCryptoParams* aParams); sl@0: sl@0: /** sl@0: Helper function implemented by concrete cipher sub-class that allows sl@0: GetCharacteristicsL to return the correct characteristics object. sl@0: @return The implemention uid sl@0: */ sl@0: virtual TUid ImplementationUid() const = 0; sl@0: sl@0: private: sl@0: sl@0: protected: sl@0: CKey* iPrivateKey; sl@0: CCryptoParams* iSharedParams; // common parameters between our private key and their public key sl@0: }; sl@0: } sl@0: sl@0: #endif // __KEYAGREEMENTIMPL_H__