sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* API which clients use to talk to the key management server.
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*/
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
/**
|
sl@0
|
23 |
@file
|
sl@0
|
24 |
@internalTechnology
|
sl@0
|
25 |
*/
|
sl@0
|
26 |
|
sl@0
|
27 |
#ifndef KMSCLIENT_H
|
sl@0
|
28 |
#define KMSCLIENT_H
|
sl@0
|
29 |
|
sl@0
|
30 |
#include <e32std.h>
|
sl@0
|
31 |
|
sl@0
|
32 |
#include "keyhandle.h"
|
sl@0
|
33 |
|
sl@0
|
34 |
|
sl@0
|
35 |
/** The server will panic clients with the category if it detects an error. */
|
sl@0
|
36 |
_LIT(KKmsClientPanicCat, "KmsClientPanic");
|
sl@0
|
37 |
|
sl@0
|
38 |
enum TKmsClientPanic
|
sl@0
|
39 |
/** Reasons why the KMS might panic a client. */
|
sl@0
|
40 |
{
|
sl@0
|
41 |
/**
|
sl@0
|
42 |
Client supplied an invalid descriptor. The descriptor may have been
|
sl@0
|
43 |
created by the client DLL when the client passed a bad object reference.
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
// Unfortunately 0xBADDE5C causes the techview
|
sl@0
|
46 |
// EikSrvs.exe::ViewServerThread to panic with bad descriptor
|
sl@0
|
47 |
// EBadClientDescriptor = 0xBADDE5C
|
sl@0
|
48 |
EBadClientDescriptor = -38
|
sl@0
|
49 |
};
|
sl@0
|
50 |
|
sl@0
|
51 |
class RKeyMgmtSession : public RSessionBase
|
sl@0
|
52 |
{
|
sl@0
|
53 |
public:
|
sl@0
|
54 |
IMPORT_C TInt Connect();
|
sl@0
|
55 |
IMPORT_C TInt Connect(const TVersion& aReqVer);
|
sl@0
|
56 |
|
sl@0
|
57 |
IMPORT_C TInt GenerateKey(TInt aLength, TKeyHandle& aHandle);
|
sl@0
|
58 |
IMPORT_C TInt StoreKey(const TDesC8& aData, TKeyHandle& aHandle);
|
sl@0
|
59 |
IMPORT_C TInt DeleteKey(TKeyHandle aHandle);
|
sl@0
|
60 |
IMPORT_C TInt AddUsage(TKeyHandle aHandle, TInt aOperation, const TSecurityPolicy& aSecPol);
|
sl@0
|
61 |
IMPORT_C TInt DeleteUsage(TKeyHandle aHandle, TInt aOperation);
|
sl@0
|
62 |
|
sl@0
|
63 |
IMPORT_C void SetHeapFail(TInt aValue);
|
sl@0
|
64 |
IMPORT_C void EndHeapFail();
|
sl@0
|
65 |
};
|
sl@0
|
66 |
|
sl@0
|
67 |
#endif // #ifndef KMSCLIENT_H
|
sl@0
|
68 |
|