sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * API which clients use to talk to the key management server. sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef KMSCLIENT_H sl@0: #define KMSCLIENT_H sl@0: sl@0: #include sl@0: sl@0: #include "keyhandle.h" sl@0: sl@0: sl@0: /** The server will panic clients with the category if it detects an error. */ sl@0: _LIT(KKmsClientPanicCat, "KmsClientPanic"); sl@0: sl@0: enum TKmsClientPanic sl@0: /** Reasons why the KMS might panic a client. */ sl@0: { sl@0: /** sl@0: Client supplied an invalid descriptor. The descriptor may have been sl@0: created by the client DLL when the client passed a bad object reference. sl@0: */ sl@0: // Unfortunately 0xBADDE5C causes the techview sl@0: // EikSrvs.exe::ViewServerThread to panic with bad descriptor sl@0: // EBadClientDescriptor = 0xBADDE5C sl@0: EBadClientDescriptor = -38 sl@0: }; sl@0: sl@0: class RKeyMgmtSession : public RSessionBase sl@0: { sl@0: public: sl@0: IMPORT_C TInt Connect(); sl@0: IMPORT_C TInt Connect(const TVersion& aReqVer); sl@0: sl@0: IMPORT_C TInt GenerateKey(TInt aLength, TKeyHandle& aHandle); sl@0: IMPORT_C TInt StoreKey(const TDesC8& aData, TKeyHandle& aHandle); sl@0: IMPORT_C TInt DeleteKey(TKeyHandle aHandle); sl@0: IMPORT_C TInt AddUsage(TKeyHandle aHandle, TInt aOperation, const TSecurityPolicy& aSecPol); sl@0: IMPORT_C TInt DeleteUsage(TKeyHandle aHandle, TInt aOperation); sl@0: sl@0: IMPORT_C void SetHeapFail(TInt aValue); sl@0: IMPORT_C void EndHeapFail(); sl@0: }; sl@0: sl@0: #endif // #ifndef KMSCLIENT_H sl@0: