os/security/cryptoservices/filebasedcertificateandkeystores/test/ttestplugin/cdummykeystoreclient.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2006-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
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
#ifndef __CDUMMYKEYSTORECLIENT_H__
sl@0
    20
#define __CDUMMYKEYSTORECLIENT_H__
sl@0
    21
sl@0
    22
#include <mctkeystoremanager.h>
sl@0
    23
sl@0
    24
/**
sl@0
    25
 * Implements the MCTKeyStoreManager interface.
sl@0
    26
 *
sl@0
    27
 * The class implements the keystore manager token interface for the software
sl@0
    28
 * keystore.  It will be created and owned by the unified keystore.
sl@0
    29
 */
sl@0
    30
NONSHARABLE_CLASS(CDummyKeyStoreClient) : public MCTKeyStoreManager
sl@0
    31
{
sl@0
    32
public://	One creator function for each token interface
sl@0
    33
	static MCTTokenInterface* NewKeyStoreInterfaceL(MCTToken& aToken);
sl@0
    34
sl@0
    35
public:
sl@0
    36
	virtual ~CDummyKeyStoreClient();
sl@0
    37
	void AddRef();
sl@0
    38
sl@0
    39
public:
sl@0
    40
//	*********************************************************************************	
sl@0
    41
//	MKeyStore
sl@0
    42
	virtual void List(RMPointerArray<CCTKeyInfo>& aKeys, const TCTKeyAttributeFilter& aFilter, TRequestStatus& aStatus);
sl@0
    43
	virtual void CancelList();
sl@0
    44
	virtual void GetKeyInfo(TCTTokenObjectHandle aHandle, CCTKeyInfo*& aInfo, TRequestStatus& aStatus);
sl@0
    45
	virtual void CancelGetKeyInfo();
sl@0
    46
	
sl@0
    47
	/** Open an RSA key for signing	*/
sl@0
    48
	virtual void Open(const TCTTokenObjectHandle& aHandle, 
sl@0
    49
					  MRSASigner*& aSigner,
sl@0
    50
					  TRequestStatus& aStatus);
sl@0
    51
	/** Open a DSA key for signing */
sl@0
    52
	virtual void Open(const TCTTokenObjectHandle& aHandle, 
sl@0
    53
					  MDSASigner*& aSigner, 
sl@0
    54
					  TRequestStatus& aStatus);
sl@0
    55
	/** Open a RSA key for private decryption */
sl@0
    56
	virtual void Open(const TCTTokenObjectHandle& aHandle, 
sl@0
    57
					  MCTDecryptor*& aDecryptor,
sl@0
    58
					  TRequestStatus& aStatus);
sl@0
    59
	/** Open a DH key for key agreement */
sl@0
    60
	virtual void Open(const TCTTokenObjectHandle& aHandle, 
sl@0
    61
					  MCTDH*& aDH, TRequestStatus& aStatus);
sl@0
    62
sl@0
    63
sl@0
    64
	/// Cancels an ongoing open request
sl@0
    65
	virtual void CancelOpen();
sl@0
    66
	
sl@0
    67
	/** Returns the public key in DER-encoded ASN-1 */
sl@0
    68
	virtual void ExportPublic(const TCTTokenObjectHandle& aHandle,
sl@0
    69
							  HBufC8*& aPublicKey,
sl@0
    70
							  TRequestStatus& aStatus);
sl@0
    71
	virtual void CancelExportPublic();
sl@0
    72
sl@0
    73
public:
sl@0
    74
//	*********************************************************************************	
sl@0
    75
//	MCTKeyStoreManager
sl@0
    76
	virtual void CreateKey(CCTKeyInfo*& aReturnedKey, TRequestStatus& aStatus);
sl@0
    77
	virtual void CancelCreateKey();
sl@0
    78
	virtual void ImportKey(const TDesC8& aKey, CCTKeyInfo*& aReturnedKey, TRequestStatus& aStatus);
sl@0
    79
	virtual void CancelImportKey();
sl@0
    80
	virtual void ImportEncryptedKey(const TDesC8& aKey, CCTKeyInfo*& aReturnedKey, TRequestStatus& aStatus);
sl@0
    81
	virtual void CancelImportEncryptedKey();
sl@0
    82
	virtual void ExportKey(TCTTokenObjectHandle aHandle, HBufC8*& aKey, TRequestStatus& aStatus); 
sl@0
    83
	virtual void CancelExportKey();
sl@0
    84
	virtual void ExportEncryptedKey(TCTTokenObjectHandle aHandle, const CPBEncryptParms& aParams, HBufC8*& aKey, TRequestStatus& aStatus);
sl@0
    85
	virtual void CancelExportEncryptedKey();
sl@0
    86
	virtual void DeleteKey(TCTTokenObjectHandle aHandle, TRequestStatus& aStatus);
sl@0
    87
	virtual void CancelDeleteKey();	
sl@0
    88
	virtual void SetUsePolicy(TCTTokenObjectHandle aHandle, const TSecurityPolicy& aPolicy, TRequestStatus& aStatus);
sl@0
    89
	virtual void CancelSetUsePolicy();
sl@0
    90
	virtual void SetManagementPolicy(TCTTokenObjectHandle aHandle, const TSecurityPolicy& aPolicy, TRequestStatus& aStatus);
sl@0
    91
	virtual void CancelSetManagementPolicy();
sl@0
    92
	virtual void SetPassphraseTimeout(TInt aTimeout, TRequestStatus& aStatus);
sl@0
    93
	virtual void CancelSetPassphraseTimeout();	
sl@0
    94
	virtual void Relock(TRequestStatus& aStatus);
sl@0
    95
	virtual void CancelRelock();	
sl@0
    96
sl@0
    97
	void ReleaseObject(const TCTTokenObjectHandle& aObject);
sl@0
    98
sl@0
    99
public:	
sl@0
   100
//	*********************************************************************************
sl@0
   101
//	From MCTTokenInterface
sl@0
   102
	virtual MCTToken& Token();
sl@0
   103
sl@0
   104
public:
sl@0
   105
//	*********************************************************************************
sl@0
   106
	void RepudiableDSASign(const TCTTokenObjectHandle& aObject, const TDesC8& aDigest, CDSASignature*& aSignature, TRequestStatus& aStatus);
sl@0
   107
	void RepudiableRSASign(const TCTTokenObjectHandle& aObject, const TDesC8& aDigest, CRSASignature*& aSignature, TRequestStatus& aStatus);
sl@0
   108
	void Decrypt(const TCTTokenObjectHandle& aObject, const TDesC8& aCiphertext, TDes8& aPlaintext, TRequestStatus& aStatus);
sl@0
   109
	void DHPublicKey(const TCTTokenObjectHandle& aHandle, const TInteger& aN, const TInteger& aG, CDHPublicKey*& aX, TRequestStatus& aStatus);
sl@0
   110
	void DHAgree(const TCTTokenObjectHandle& aHandle, const CDHPublicKey& iY, HBufC8*& aAgreedKey, TRequestStatus& aStatus);
sl@0
   111
sl@0
   112
protected:
sl@0
   113
//	*********************************************************************************
sl@0
   114
//	From MCTTokenInterface
sl@0
   115
	virtual void DoRelease();
sl@0
   116
protected:
sl@0
   117
//	*********************************************************************************
sl@0
   118
	CDummyKeyStoreClient(MCTToken& aToken);
sl@0
   119
	virtual void ConstructL();
sl@0
   120
sl@0
   121
private:
sl@0
   122
	TInt iRefCount;
sl@0
   123
	
sl@0
   124
private:
sl@0
   125
	MCTToken& iToken;					///< The token we belong to
sl@0
   126
};
sl@0
   127
sl@0
   128
#endif	//	__CDUMMYKEYSTORECLIENT_H__