authenticationservices/authenticationserver/inc/authserver/identity.h
changeset 29 ece3df019add
equal deleted inserted replaced
19:cd501b96611d 29:ece3df019add
       
     1 /*
       
     2 * Copyright (c) 2005-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 * CIdentity declaration
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @publishedAll
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef IDENTITY_H
       
    27 #define IDENTITY_H
       
    28 
       
    29 #include "authserver/authtypes.h"
       
    30 #include "authserver/protectionkey.h"
       
    31 
       
    32 namespace AuthServer
       
    33 {
       
    34 /**
       
    35  * CIdentity is an client side class of the authentication server. 
       
    36  * CIdentity is returned as the result of an authentication.
       
    37  * 
       
    38  */
       
    39 class CIdentity : public CBase
       
    40 	{
       
    41 public:
       
    42 
       
    43     IMPORT_C static CIdentity* NewL(TIdentityId aId,
       
    44 									CProtectionKey* aKey,
       
    45 									HBufC* aString);
       
    46 	
       
    47     IMPORT_C static CIdentity* NewLC(TIdentityId aId,
       
    48 									 CProtectionKey* aKey,
       
    49 									 HBufC* aString);
       
    50 	
       
    51     IMPORT_C static CIdentity* NewL(RReadStream& aStream);
       
    52     IMPORT_C static CIdentity* NewLC(RReadStream& aStream);
       
    53     
       
    54 	virtual ~CIdentity();
       
    55 
       
    56 	IMPORT_C TIdentityId Id() const;
       
    57 
       
    58 	IMPORT_C const CProtectionKey& Key() const;
       
    59 
       
    60 	IMPORT_C TDesC& String() const;
       
    61 	
       
    62 	IMPORT_C void ExternalizeL(RWriteStream& s) const;
       
    63 	IMPORT_C static CIdentity* InternalizeL(RReadStream& s);
       
    64 
       
    65 private:
       
    66 	void ConstructL(CProtectionKey* aKey,
       
    67 					HBufC* aString);
       
    68 	
       
    69 	CIdentity(TIdentityId aId);
       
    70 
       
    71 private:
       
    72     TIdentityId           iId;
       
    73     CProtectionKey* iKey;
       
    74 	HBufC*                iString;
       
    75 	};
       
    76 }
       
    77 
       
    78 #endif // IDENTITY_H