os/security/crypto/weakcryptospi/test/tplugins/src/verifierimpl.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2010 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 #include <e32def.h>
    20 #include <e32cmn.h>
    21 #include <cryptospi/keys.h>
    22 
    23 #include "verifierimpl.h"
    24 
    25 #include <cryptospi/cryptospidef.h>
    26 #include "pluginconfig.h"
    27 
    28 using namespace SoftwareCrypto;
    29 
    30 CVerifierImpl::CVerifierImpl()
    31 	{
    32 	}
    33 
    34 CVerifierImpl::~CVerifierImpl()
    35 	{
    36 	delete iKey;	
    37 	}
    38 
    39 void CVerifierImpl::Close()
    40 	{
    41 	delete this;
    42 	}
    43 	
    44 void CVerifierImpl::Reset()
    45 	{
    46 	}
    47 	
    48 TAny* CVerifierImpl::GetExtension(TUid /*aExtendsionId*/)
    49 	{
    50 	return 0;
    51 	}
    52 	
    53 void CVerifierImpl::GetCharacteristicsL(const TAny*& aPluginCharacteristics)
    54 	{
    55 	TInt numCiphers = sizeof(KVerifierCharacteristics)/sizeof(TAsymmetricSignatureCharacteristics*);
    56 	TInt32 implUid = ImplementationUid().iUid;
    57 	for (TInt i = 0; i < numCiphers; ++i)
    58 		{
    59 		if (KVerifierCharacteristics[i]->cmn.iImplementationUID == implUid)
    60 			{
    61 			aPluginCharacteristics = KVerifierCharacteristics[i];
    62 			break;
    63 			}
    64 		}
    65 	}
    66 
    67 void CVerifierImpl::SetPaddingModeL(TUid /*aPaddingMode*/) 
    68 	{
    69 	}
    70 
    71 void CVerifierImpl::SetKeyL(const CKey& /*aPublicKey*/)
    72 	{
    73 	}
    74 
    75 TInt CVerifierImpl::GetMaximumInputLengthL() const
    76 	{
    77 	// Override in subclass
    78 	User::Leave(KErrNotSupported);
    79 	return 0;
    80 	}
    81 
    82 TInt CVerifierImpl::GetMaximumOutputLengthL() const
    83 	{
    84 	// Override in subclass
    85 	User::Leave(KErrNotSupported);
    86 	return 0;
    87 	}
    88 
    89 void CVerifierImpl::DoSetKeyL(const CKey& aKey)
    90 	{
    91 	delete iKey;
    92 	iKey = CKey::NewL(aKey);
    93 	}
    94 
    95 void CVerifierImpl::ConstructL(const CKey& aPrivateKey)
    96 	{
    97 	SetKeyL(aPrivateKey);	
    98 	}