crypto/weakcryptospi/source/spi/extendedcharacteristics.cpp
changeset 8 35751d3474b7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 /*
       
     2 * Copyright (c) 2006-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 * crypto plugin extended characteristic implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include <cryptospi/extendedcharacteristics.h>
       
    21 #include <cryptospi/plugincharacteristics.h>
       
    22 #include <cryptospi/cryptospidef.h>
       
    23 
       
    24 using namespace CryptoSpi;
       
    25 
       
    26 //
       
    27 // Implementation of Extended Characteristics
       
    28 //
       
    29 
       
    30 EXPORT_C CExtendedCharacteristics* CExtendedCharacteristics::NewL(TInt aAvailableConcurrency,
       
    31 																	TBool aExclusiveUse)
       
    32 	{
       
    33 	CExtendedCharacteristics* self = new(ELeave) CExtendedCharacteristics();
       
    34 	CleanupStack::PushL(self);
       
    35 	self->ConstructL(aAvailableConcurrency, aExclusiveUse);
       
    36 	CleanupStack::Pop();
       
    37 	return self;
       
    38 	}
       
    39 
       
    40 EXPORT_C CExtendedCharacteristics::~CExtendedCharacteristics()
       
    41 	{
       
    42 	delete iExtCharacteristics;
       
    43 	}
       
    44 
       
    45 EXPORT_C void CExtendedCharacteristics::AddCharacteristicL(const TInt aValue, TUid aUid)
       
    46 	{
       
    47 	iExtCharacteristics->AddL(aValue, aUid);
       
    48 	}
       
    49 
       
    50 EXPORT_C void CExtendedCharacteristics::AddCharacteristicL(const TDesC8& aValue, TUid aUid)
       
    51 	{
       
    52 	iExtCharacteristics->AddL(aValue, aUid);
       
    53 	}
       
    54 
       
    55 EXPORT_C TInt CExtendedCharacteristics::GetTIntCharacteristicL(TUid aUid) const
       
    56 	{
       
    57 	return iExtCharacteristics->GetTIntL(aUid);
       
    58 	}
       
    59 
       
    60 EXPORT_C const TDesC8& CExtendedCharacteristics::GetTDesC8CharacteristicL(TUid aUid) const
       
    61 	{
       
    62 	return iExtCharacteristics->GetTDesC8L(aUid);
       
    63 	}
       
    64 
       
    65 EXPORT_C const CCryptoParams* CExtendedCharacteristics::ListExtendedCharacteristics() const
       
    66 	{
       
    67 	return iExtCharacteristics;
       
    68 	}
       
    69 
       
    70 void CExtendedCharacteristics::ConstructL(TInt aAvailableConcurrency, TBool aExclusiveUse)
       
    71 	{
       
    72 	iExtCharacteristics = CCryptoParams::NewL();
       
    73 	iExtCharacteristics->AddL(aAvailableConcurrency, KConcurrencyTypeUid);
       
    74 	iExtCharacteristics->AddL(aExclusiveUse, KExclusiveUseTypeUid);
       
    75 	}
       
    76 
       
    77 CExtendedCharacteristics::CExtendedCharacteristics()
       
    78 	{
       
    79 	}