2 * Copyright (c) 2001-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.
27 #ifndef __TCTTOKENOBJECTHANDLE_H__
28 #define __TCTTOKENOBJECTHANDLE_H__
31 #include <ct/tcttokenhandle.h>
35 * Defines a handle to an object represented by a class which is a subclass of
36 * the MCTTokenObject class.
38 * The handle identifies the object, not the instance of the subclass of MCTTokenObject
39 * used to manage that object. It is guaranteed to be unique within the context
40 * of a specific device (e.g. mobile phone, etc.) at a specific point in time.
41 * This limitation in time is due to the fact that objects can be created and
42 * destroyed. We cannot guarantee that a handle will still point to the same
43 * object after we add or remove one or more objects from the store from which
44 * the object comes. However, it is guaranteed that the addition of objects to
45 * the store will not affect the validity of the handles that were obtained previously.
46 * For instance, if the object is a certificate in a certificate store, the subclass
47 * of MCTTokenObject will be CCTCertInfo and the handle will identify the certificate
48 * in the certificate store, not the instance of CCTCertInfo.
50 * The handle is especially useful for communication across process boundaries.
51 * For example: a process (A) can get a handle to an object, and then give the handle
52 * to another process (B). This process (B) can then try to get the same object using that handle.
56 class TCTTokenObjectHandle
60 * Creates an invalid handle.
62 * An invalid handle has an invalid iTokenHandle and an iObjectId equal to 0.
64 IMPORT_C TCTTokenObjectHandle();
69 * @param aTokenHandle The handle that identifies the Token where the object
71 * @param aObjectId The identifier of the object within the Token.
73 IMPORT_C TCTTokenObjectHandle(TCTTokenHandle aTokenHandle, TInt aObjectId);
78 * @param aTokenHandle The handle to copy.
80 IMPORT_C TCTTokenObjectHandle(const TCTTokenObjectHandle& aTokenHandle);
85 * Tests whether this TCTTokenObjectHandle object is equal to the specified
86 * TCTTokenObjectHandle object.
88 * @param aTokenHandle The TCTTokenObjectHandle object to be compared.
89 * @return ETrue, if thisTCTTokenObjectHandle object is equal to
90 * the specified TCTTokenObjectHandle object; EFalse otherwise.
92 IMPORT_C TBool operator ==(const TCTTokenObjectHandle& aTokenHandle) const;
94 /** Inequality operator */
95 inline TBool operator !=(const TCTTokenObjectHandle& aTokenHandle) const;
98 /** The handle that identifies the Token where the object is stored. */
99 TCTTokenHandle iTokenHandle;
102 * The identifier of the object within the Token.
104 * This is unique within the context of a particular Token and only at a specific
110 inline TBool TCTTokenObjectHandle::operator !=(const TCTTokenObjectHandle& aHandle) const
112 return !(*this == aHandle);