1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/crypto/weakcryptospi/source/spi/cryptospisetup/cryptospisetup.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,80 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* characteristicsetup.cpp
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @internalComponent
1.26 +*/
1.27 +
1.28 +#include <e32base.h>
1.29 +#include <cryptospi/cryptospidef.h>
1.30 +#include "cryptopluginsloader.h"
1.31 +
1.32 +using namespace CryptoSpi;
1.33 +
1.34 +void CreatePropertiesL()
1.35 + {
1.36 + //
1.37 + //Create plugin loader
1.38 + //
1.39 + CCryptoPluginsLoader* plugins=CCryptoPluginsLoader::NewLC();
1.40 +
1.41 + //
1.42 + //Create the plugin config property
1.43 + //
1.44 + plugins->CreatePluginConfigPropertyL();
1.45 +
1.46 + //
1.47 + //Create crypto interface property
1.48 + //
1.49 + TInt interfaceCount=sizeof(KInterfacesUids)/sizeof(KInterfacesUids[0]);
1.50 + for (TInt i=0;i<interfaceCount;i++)
1.51 + {
1.52 + plugins->CreateInterfacePropertyL(KInterfacesUids[i].iUid);
1.53 + }
1.54 +
1.55 + //
1.56 + //Cleanup
1.57 + //
1.58 + CleanupStack::PopAndDestroy(plugins);
1.59 + }
1.60 +
1.61 +/**
1.62 + * @return KErrNone (0) if successful, KErrMemory if out of memory
1.63 + * otherwise error result from calling RProperty::Define/Set
1.64 + */
1.65 +TInt E32Main()
1.66 + {
1.67 + __UHEAP_MARK;
1.68 + CTrapCleanup* trapCleanup=CTrapCleanup::New();
1.69 + if (!trapCleanup)
1.70 + {
1.71 + return KErrNoMemory;
1.72 + }
1.73 +
1.74 + TRAPD(err, CreatePropertiesL());
1.75 +
1.76 + delete trapCleanup;
1.77 + __UHEAP_MARKEND;
1.78 + return err;
1.79 + }
1.80 +
1.81 +
1.82 +
1.83 +