os/security/cryptoservices/filebasedcertificateandkeystores/test/thwkeystore/client/thwtokenclient.cpp
Update contrib.
2 * Copyright (c) 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.
19 #include "thwtokenclient.h"
20 #include "thwkeystoreclient.h"
22 _LIT(KTokenString, "Hardware plugin implementation");
25 MCTToken* CHardwareTokenClient::NewL(MCTTokenType* aTokenType)
27 CHardwareTokenClient* self = new (ELeave) CHardwareTokenClient(aTokenType);
28 return static_cast<MCTToken*>(self);
31 CHardwareTokenClient::CHardwareTokenClient(MCTTokenType* aTokenType)
32 : iTokenType(aTokenType),
37 MCTTokenType& CHardwareTokenClient::TokenType()
42 const TDesC& CHardwareTokenClient::Label()
44 return KTokenString();
47 TCTTokenHandle CHardwareTokenClient::Handle()
49 return (TCTTokenHandle(iTokenType->Type(), 0));
52 TInt& CHardwareTokenClient::ReferenceCount()
57 void CHardwareTokenClient::DoGetInterface(TUid aRequiredInterface, MCTTokenInterface*& aReturnedInterface, TRequestStatus& aStatus)
59 // No longer calls server to get the interface - just creates a client object of the appropriate type
60 TUid userUid = {0x101F7334};
61 TUid managerUid = {0x101F7335};
63 aReturnedInterface = NULL;
64 TInt err = KErrGeneral;
66 if( userUid == aRequiredInterface || managerUid == aRequiredInterface )
68 TRAP(err, aReturnedInterface = CHardwareKeyStoreClient::NewKeyStoreInterfaceL(*this));
71 if (NULL == aReturnedInterface)
76 TRequestStatus* status = &aStatus;
77 User::RequestComplete(status, err);
80 TBool CHardwareTokenClient::DoCancelGetInterface()
81 {// Not an asynchronous call for current file store, so nothing to do
85 const TDesC& CHardwareTokenClient::Information(TTokenInformation /*aRequiredInformation*/)