os/security/crypto/weakcryptospi/test/kms/exported_include/kmsclient.h
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 * API which clients use to talk to the key management server.
    16 *
    17 */
    18 
    19 
    20 
    21 
    22 /**
    23  @file 
    24  @internalTechnology
    25 */
    26 
    27 #ifndef KMSCLIENT_H
    28 #define KMSCLIENT_H
    29 
    30 #include <e32std.h>
    31 
    32 #include "keyhandle.h"
    33 
    34 
    35 /** The server will panic clients with the category if it detects an error. */
    36 _LIT(KKmsClientPanicCat, "KmsClientPanic");
    37 
    38 enum TKmsClientPanic
    39 /** Reasons why the KMS might panic a client. */
    40 	{
    41 	/**
    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.
    44 	 */
    45     //  Unfortunately 0xBADDE5C causes the techview
    46     //  EikSrvs.exe::ViewServerThread to panic with bad descriptor
    47 	//	EBadClientDescriptor = 0xBADDE5C
    48 	EBadClientDescriptor = -38
    49 	};
    50 
    51 class RKeyMgmtSession : public RSessionBase
    52 	{
    53 public:
    54 	IMPORT_C TInt Connect();
    55 	IMPORT_C TInt Connect(const TVersion& aReqVer);
    56 	
    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);
    62 
    63 	IMPORT_C void SetHeapFail(TInt aValue);
    64 	IMPORT_C void EndHeapFail();
    65 	};
    66 
    67 #endif	// #ifndef KMSCLIENT_H
    68