diff -r cd501b96611d -r ece3df019add authenticationservices/authenticationserver/source/server/transientkey.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/authenticationservices/authenticationserver/source/server/transientkey.h Tue Nov 24 09:06:03 2009 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* CTransientKey declaration +* +*/ + + +/** + @file + @released + @internalComponent +*/ + +#ifndef TRANSIENTKEY_H +#define TRANSIENTKEY_H + +#include +#include "authserver_client.h" +#include "encryptedprotectionkey.h" + +namespace AuthServer +{ + +/** + * CTransientKey is a cryptographic key that is generated on the fly and never + * stored on the device. Transient keys are used to encrypt and decrypt + * protection keys, they are generated by the AuthServer using data gathered + * from CAuthPlugin derived classes. + */ +class CTransientKey : public CBase + { +public: + + /** + * Creates a new transient key, passing in the plugin data from which to + * derive it. + * + * @param aEncryptor encryption element to use as the key. Ownership + * passes to this object. + **/ + static CTransientKey* NewL(CPBEncryptElement* aEncryptor); + + /** + * Creates a new transient key, passing in the plugin data from which to + * derive it. + * + * @param aEncryptor encryption element to use as the key. Ownership + * passes to this object. + **/ + static CTransientKey* NewLC(CPBEncryptElement* aEncryptor); + + ~CTransientKey(); + + /** + * Create an version of the provided protection key encrypted by this + * key. Ownership of the returned object is passed to the caller. + * + * @param aKey the protection key to encrypt. + * + * @return an protection key encrypted by this key. + **/ + CEncryptedProtectionKey* EncryptL(const CProtectionKey& aKey) const; + + /** + * Decrypts an CEncryptedProtectionKey created by this transient + * key. Ownership of the returned object is passed to the caller. + * + * @param aKey the encrypted protection key to decrypt. + * + * @return a protection key + **/ + CProtectionKey* DecryptL(const CEncryptedProtectionKey& aKey) const; + + +private: + void ConstructL(CPBEncryptElement* aEncryptor); + + CPBEncryptElement* iPbeElement; + }; +} + +#endif // TRANSIENTKEY_H