First public contribution.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * API which clients use to talk to the key management server.
32 #include "keyhandle.h"
35 /** The server will panic clients with the category if it detects an error. */
36 _LIT(KKmsClientPanicCat, "KmsClientPanic");
39 /** Reasons why the KMS might panic a client. */
42 Client supplied an invalid descriptor. The descriptor may have been
43 created by the client DLL when the client passed a bad object reference.
45 // Unfortunately 0xBADDE5C causes the techview
46 // EikSrvs.exe::ViewServerThread to panic with bad descriptor
47 // EBadClientDescriptor = 0xBADDE5C
48 EBadClientDescriptor = -38
51 class RKeyMgmtSession : public RSessionBase
54 IMPORT_C TInt Connect();
55 IMPORT_C TInt Connect(const TVersion& aReqVer);
57 IMPORT_C TInt GenerateKey(TInt aLength, TKeyHandle& aHandle);
58 IMPORT_C TInt StoreKey(const TDesC8& aData, TKeyHandle& aHandle);
59 IMPORT_C TInt DeleteKey(TKeyHandle aHandle);
60 IMPORT_C TInt AddUsage(TKeyHandle aHandle, TInt aOperation, const TSecurityPolicy& aSecPol);
61 IMPORT_C TInt DeleteUsage(TKeyHandle aHandle, TInt aOperation);
63 IMPORT_C void SetHeapFail(TInt aValue);
64 IMPORT_C void EndHeapFail();
67 #endif // #ifndef KMSCLIENT_H