os/security/cryptoplugins/cryptospiplugins/test/h4drv/crypto_h4/cryptoh4.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @internalComponent
    22  @released
    23 */
    24 #ifndef __CRYPTOH4__
    25 #define __CRYPTOH4__
    26 #include "cryptoldd.h"
    27 
    28 class DCryptoPddFactory : public DPhysicalDevice
    29     {
    30 public:
    31     DCryptoPddFactory();
    32 	~DCryptoPddFactory();
    33     // Inherited from DPhysicalDevice
    34     virtual TInt Install();
    35     // Inherited from DPhysicalDevice
    36     virtual void GetCaps(TDes8& aDes) const;
    37     // Inherited from DPhysicalDevice
    38     virtual TInt Create(DBase*& aChannel, TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
    39     // Inherited from DPhysicalDevice
    40     virtual TInt Validate(TInt aUnit, const TDesC8* aInfo, const TVersion& aVer);
    41 
    42 	TDfcQue *DfcQue();
    43 	static void DeleteDfcQFunc(TAny *any);
    44 
    45 public:
    46     enum TMinimumLDDVersion
    47         {
    48         EMinimumLddMajorVersion=1,
    49         EMinimumLddMinorVersion=0,
    50         EMinimumLddBuild=0 //Not used
    51         };
    52 private:
    53 	TBool iDfcQueInitialised;
    54 	TDfcQue *iDfcQue; // Will be deleted by the deleteDfcQDfc started by our destructor
    55     };
    56 
    57 
    58 
    59 class CryptoJobRandom;
    60 class CryptoJobAes;
    61 class DCryptoH4Chan : public DCryptoPddChannel
    62 	{
    63 public:
    64 	DCryptoH4Chan(DCryptoPddFactory &iCryptoPddFactory);
    65     ~DCryptoH4Chan();
    66 
    67     TInt DoCreate();
    68 
    69 	virtual TDfcQue* DfcQue();
    70 
    71     virtual void GetHwVersions(RCryptoDriver::THwVersions& aHwVersions) const;
    72 
    73     virtual TInt FakeDriverSetting() const;
    74     virtual TInt SetFakeDriverSetting(TInt aFakeDriverSetting);
    75 
    76 	virtual CryptoJobRandom *GetJobRandom(TBool aAutoCreate = ETrue);
    77 	virtual CryptoJobAes *GetJobAes(TBool aAutoCreate = ETrue);
    78 
    79 private:
    80 	DCryptoPddFactory &iCryptoPddFactory;
    81 
    82     TInt iFakeDriverSetting;
    83 
    84 	CryptoJobRandom *iCryptoJobRandom;
    85 	CryptoJobAes *iCryptoJobAes;
    86 	};
    87 
    88 
    89 
    90 
    91 #endif