os/security/crypto/weakcryptospi/source/spi/cryptospisetup/cryptospisetup.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 * characteristicsetup.cpp
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @internalComponent
    23 */
    24 
    25 #include <e32base.h>
    26 #include <cryptospi/cryptospidef.h>
    27 #include "cryptopluginsloader.h"
    28 
    29 using namespace CryptoSpi;
    30 
    31 void CreatePropertiesL()
    32 	{
    33 	//
    34 	//Create plugin loader
    35 	//
    36 	CCryptoPluginsLoader* plugins=CCryptoPluginsLoader::NewLC();
    37 	
    38 	//
    39 	//Create the plugin config property
    40 	//	
    41 	plugins->CreatePluginConfigPropertyL();
    42 	
    43 	//
    44 	//Create crypto interface property
    45 	//
    46 	TInt interfaceCount=sizeof(KInterfacesUids)/sizeof(KInterfacesUids[0]);
    47 	for (TInt i=0;i<interfaceCount;i++)
    48 		{
    49 		plugins->CreateInterfacePropertyL(KInterfacesUids[i].iUid);	
    50 		}
    51 	
    52 	//
    53 	//Cleanup
    54 	//
    55 	CleanupStack::PopAndDestroy(plugins);
    56 	}
    57 
    58 /**
    59  * @return KErrNone (0) if successful, KErrMemory if out of memory
    60  * otherwise error result from calling RProperty::Define/Set
    61  */
    62 TInt E32Main()
    63 	{
    64 	__UHEAP_MARK;
    65 	CTrapCleanup* trapCleanup=CTrapCleanup::New();
    66 	if (!trapCleanup)
    67 		{
    68 		return KErrNoMemory;
    69 		}
    70 		
    71 	TRAPD(err, CreatePropertiesL());
    72 	
    73 	delete trapCleanup;
    74 	__UHEAP_MARKEND;
    75 	return err;
    76 	}
    77 		
    78 
    79 
    80