RMobileSmartCardEap Class Reference

class RMobileSmartCardEap : public RTelSubSessionBase

This sub-session opens under RMobilePhone .

RMobileSmartCardEap provides the client with access to a Smart Card Application's EAP-capability (if one exists).

(See ETSI TS 102.310 v6.2.0 and RFC3748)

To submit authentication challenges or requests, a client must use CAsyncSmartCardEapAuthentication in conjunction with this sub-session.

CAsyncSmartCardEapAuthentication

Inherits from

Public Member Functions
RMobileSmartCardEap ()
IMPORT_C void Close ()
IMPORT_C void GetAuthenticationStatus ( TRequestStatus &, TEapAuthStatus &)
IMPORT_C void GetEapKey ( TRequestStatus &, const TEapKeyTag , TDes8 &)
IMPORT_C TInt GetEapMethodAccessStatus ( TEapMethodAccessStatus &)
IMPORT_C void GetUserIdentity ( TRequestStatus &, TEapUserIdType , TDes8 &)
IMPORT_C void InitialiseEapMethod ( TRequestStatus &)
IMPORT_C TBool IsEapMethodOwner ()
IMPORT_C void NotifyEapMethodAccessStatusChange ( TRequestStatus &, TEapMethodAccessStatus &)
IMPORT_C TInt Open ( RMobilePhone &, const RMobilePhone::TAID &, const TEapType &)
IMPORT_C TInt ReleaseEapMethod ()
Protected Member Functions
IMPORT_C void ConstructL ()
IMPORT_C void Destruct ()
Private Member Functions
RMobileSmartCardEap (const RMobileSmartCardEap &)
void ConvertBinToText (const TDesC8 &, TDes &)
TChar SeptChar ( TInt )
Inherited Functions
RSubSessionBase::CloseSubSession(TInt)
RSubSessionBase::CreateAutoCloseSubSession(RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt)
RSubSessionBase::CreateSubSession(const RSessionBase &,TInt,const TIpcArgs &)
RSubSessionBase::RSubSessionBase()
RSubSessionBase::Send(TInt)const
RSubSessionBase::Send(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt)const
RSubSessionBase::SendReceive(TInt,TRequestStatus &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSubSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSubSessionBase::Session()const
RSubSessionBase::SubSessionHandle()const
RTelSubSessionBase::Blank(const TInt,TReqPriorityType)const
RTelSubSessionBase::Blank(const TInt,TRequestStatus &,TReqPriorityType)const
RTelSubSessionBase::CancelAsyncRequest(TInt)const
RTelSubSessionBase::CancelReq(const TInt,const TInt)const
RTelSubSessionBase::CancelSubSession()const
RTelSubSessionBase::Get(const TInt,TDes16 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes8 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes8 &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes16 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes8 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes8 &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::Get(const TInt,TRequestStatus &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::RTelSubSessionBase()
RTelSubSessionBase::ResetSessionHandle()
RTelSubSessionBase::SessionHandle()const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC16 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC8 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,TRequestStatus &,const TDesC8 &,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const RFile &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC16 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC8 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::Set(const TInt,const TDesC8 &,const TDesC8 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,TDes8 &,const TDesC16 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,const TDesC16 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,const TDesC8 &,TDes16 &,TReqPriorityType)const
RTelSubSessionBase::SetAndGet(const TInt,TRequestStatus &,const TDesC8 &,TDes8 &,TReqPriorityType)const
RTelSubSessionBase::SetSessionHandle(RSessionBase &)
RTelSubSessionBase::SubSessionHandle()
Public Member Enumerations
enum TEapAuthStatus { ENoAuthStarted , EAuthenticating , EAuthenticated , EHeld }
enum TEapKeyTag { EEapKeyMSK  = 0x80, EEapKeyEMSK  = 0x81 }
enum TEapMethodAccessStatus { EEapMethodAvailable , EEapMethodInUseApplicationActive , EEapMethodInUseApplicationInactive , EEapMethodUnableToInitialise }
enum TEapUserIdType { EPermanentIdentity , EPseudonymIdentity }
Inherited Enumerations
RTelSubSessionBase:TReqPriorityType
Public Member Type Definitions
typedef TPckg < TEapKeyV6 > TEapKeyV6Pckg
typedef TBuf8 < KEapTypeSize > TEapType
typedef TPckg < TEapUserIdentityV6 > TEapUserIdentityV6Pckg
Private Attributes
CMobileSmartCardEapPtrHolder * iMmPtrHolder
TBool iOwnsEapMethodLock
RSemaphore iSemaphore
Inherited Attributes
RTelSubSessionBase::iPtrHolder

Constructor & Destructor Documentation

RMobileSmartCardEap()

IMPORT_C RMobileSmartCardEap ( )

Default empty constructor, and is present only to support virtual function table export.

RMobileSmartCardEap(const RMobileSmartCardEap &)

RMobileSmartCardEap ( const RMobileSmartCardEap & ) [private]

Parameters

const RMobileSmartCardEap &

Member Functions Documentation

Close()

IMPORT_C void Close ( )

This function member closes a RMobileSmartCardEap sub-session. The Close() request also attempts to release this instance's lock on the <AID,EAPType> (DF_EAP).

panic
Panics the client with ETel Panic EEtelPanicHandleNotClosed, if this instance owns the lock on the DF_EAP but could not release some resource to allow other instances to gain access. (However, it should be noted that the TSY can take control of DF_EAP access in the event that a client dies in such a manner.)
RMobileSmartCardEap::ReleaseEapMethod()
capability
None

ConstructL()

IMPORT_C void ConstructL ( ) [protected]

Delayed construction of heap stored data members.

leave
KErrNoMemory Heap memory allocation failure for CMobileSmartCardEapPtrHolder object.

ConvertBinToText(const TDesC8 &, TDes &)

void ConvertBinToText ( const TDesC8 & aBinData,
TDes & aText
) [private]

This function is used by RMobileSmartCardEap::Open() to convert the TAID (which is binary data) to a string that can be passed through ETel. The conversion changes the binary data to a string of hexadecimal semi-octets.

RMobileSmartCardEap::Open()

Parameters

const TDesC8 & aBinData Buffer containing the binary data to be converted.
TDes & aText Buffer will contain the text representation of aBinData on return.

Destruct()

IMPORT_C void Destruct ( ) [protected]

Called internally when RMobileSmartCardEap instance is no longer required, to ensure clean up of data members from memory.

GetAuthenticationStatus(TRequestStatus &, TEapAuthStatus &)

IMPORT_C void GetAuthenticationStatus ( TRequestStatus & aReqStatus,
TEapAuthStatus & aAuthStatus
)

The authentication status is obtained from the EAP supporting UICC application's EF_EAPSTATUS. It specifies the current state of authentication in the DF_EAP.

capability
ReadDeviceData

Parameters

TRequestStatus & aReqStatus Returns the result code after the asynchronous call completes.
TEapAuthStatus & aAuthStatus On request completion, will store the current authentication status of the DF_EAP.

GetEapKey(TRequestStatus &, const TEapKeyTag, TDes8 &)

IMPORT_C void GetEapKey ( TRequestStatus & aReqStatus,
const TEapKeyTag aRequestedKey,
TDes8 & aKey
)

Retrieves the generated key stored in EF_EAPKEYS of the DF_EAP (see section 7.1 of ETSI TS 102.310 v6.2.0).

capability
ReadDeviceData

Parameters

TRequestStatus & aReqStatus Returns the result code after the asynchronous call completes.
const TEapKeyTag aRequestedKey Used to specify which of the keys the client is requesting.
TDes8 & aKey Populated with the requested key on request completion.

GetEapMethodAccessStatus(TEapMethodAccessStatus &)

IMPORT_C TInt GetEapMethodAccessStatus ( TEapMethodAccessStatus & aEapMethodStatus )

Synchronous request to get the current status of the DF_EAP. This state value is held by the platform to ensure exclusive access to a DF_EAP; it is NOT a state of any Smart Card Application file.

capability
ReadDeviceData

Parameters

TEapMethodAccessStatus & aEapMethodStatus Returns the sub-session's current value of RMobileSmartCardEap::TEapMethodAccessStatus.

GetUserIdentity(TRequestStatus &, TEapUserIdType, TDes8 &)

IMPORT_C void GetUserIdentity ( TRequestStatus & aReqStatus,
TEapUserIdType aRequestedIdType,
TDes8 & aUserId
)

This method allows the client to retrieve the user identity data to be used for an EAP based authentication. The client will specify which identity type they want to read by setting the aRequestIdType parameter to the appropriate enumeration value. The user Id data is returned as a packaged instance of TEapUserIdentityV6 within the aUserId.

An example base band functionality that would be used to service this request is the +CEPR (see section 8.48 of 3GPP TS 27.007 v6.8.0) AT- command, which returns "identity" and "pseudonym" as two of its defined values.

EF_PUId and EF_Ps hold these identities (specified in sections 7.3 and 7.4, respectively, of ETSI TS 102.310 v6.2.0).

capability
ReadDeviceData

Parameters

TRequestStatus & aReqStatus Returns the result code after the asynchronous call completes.
TEapUserIdType aRequestedIdType
TDes8 & aUserId On completion, will be populated with the user identity requested by the client.

InitialiseEapMethod(TRequestStatus &)

IMPORT_C void InitialiseEapMethod ( TRequestStatus & aReqStatus )

Initialises access to the DF_EAP. This will ensure the aAID and aEapType given in the RMobileSmartCardEap::Open() exist and are accessible. If for any reason the sub-session is inaccessible, the client can request a notification for state changes using RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() .

Parameters

TRequestStatus & aReqStatus Returns the result code after the asynchronous call completes. Successful completion is only achieved when the client is the first to request initialisation on this sub-session. KErrInUse will be returned if another RMobileSmartCardEap instance successfully achieved initialisation first. Any other error code returned as request completion, suggests another problem in the system and the client must call RMobileSmartCardEap::Close() or RMobileSmartCardEap::ReleaseEapMethod() at some point, to allow other clients to use this same <AID,EapType> sub-session.

IsEapMethodOwner()

IMPORT_C TBool IsEapMethodOwner ( ) const

Returns whether this RMobileSmartCardEap instance has ownership of its corresponding DF_EAP.

NotifyEapMethodAccessStatusChange(TRequestStatus &, TEapMethodAccessStatus &)

IMPORT_C void NotifyEapMethodAccessStatusChange ( TRequestStatus & aReqStatus,
TEapMethodAccessStatus & aEapMethodStatus
)

Notifies the client when the EAP method's (DF_EAP's) access status changes.

The status begins as EEapMethodAvailable when the DF_EAP is first used; before RMobileSmartCardEap::InitialiseEapMethod() is called by the client. EEapMethodInUseApplicationActive state is given after the first client initialises... various cases cause transformations to states EEapMethodUnableToInitialise or EEapMethodInUseApplicationInactive.

Parameters

TRequestStatus & aReqStatus Returns the result code after the asynchronous call completes.
TEapMethodAccessStatus & aEapMethodStatus Returns the RMobileSmartCardEap::TEapMethodAccessStatus value when the status changes on this sub- session.

Open(RMobilePhone &, const RMobilePhone::TAID &, const TEapType &)

IMPORT_C TInt Open ( RMobilePhone & aPhone,
const RMobilePhone::TAID & aAID,
const TEapType & aEapType
)

This function opens a RMobileSmartCardEap sub-session from RMobilePhone that will refer to the application referenced by aAID. It will be assumed that the application exists and contains a DF_EAP for the aEapType specified. The client must call RMobileSmartCardEap::InitialiseEapMethod() to ensure correct functionality of this sub-session.

Parameters

RMobilePhone & aPhone The RMobilePhone sub-session relative to which this sub-session will open.
const RMobilePhone::TAID & aAID
const TEapType & aEapType The EAP method type that this sub-session will use under the aAID application.

ReleaseEapMethod()

IMPORT_C TInt ReleaseEapMethod ( )

Relinquishes ownership of the DF_EAP, to allow other clients to use it. Although the request completes relatively quickly, it will set the server's process running to attempt a deactivate on the sub-session's corresponding application. The deactivate will allow future clients to initialise the application, which should reset all its DF_EAP states.

The initial state change of the sub-session will be EEapMethodUnableToInitialise, as the request completes without waiting for the application's deactivation. After the sub-session is able to deactivate the app, the state will change to EEapMethodAvailable.

The server will make a decision on deactivating the application based on whether there are other sub-session open to the same application (but different EAP types/ DF_EAP). Only when the application is no longer in use, that the server will deactivate it.

Notifications can be posted using RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() to observe such state changes.

SeptChar(TInt)

TChar SeptChar ( TInt aDigit ) [private]

Returns the character that corresponds to the value of its parameter (base 17!).

Parameters

TInt aDigit an integer between 0 and 16.

Member Enumerations Documentation

Enum TEapAuthStatus

Authentication status of the EAP supporting UICC application (See section 7.2 of ETSI TS 102.310 v6.2.0). One of these values is returned on completion of an RMobileSmartCardEap::GetAuthenticationStatus() request.

RMobileSmartCardEap::GetAuthenticationStatus()

Enumerators

ENoAuthStarted

No authentication started

EAuthenticating

Authenticating

EAuthenticated

Authentication complete

EHeld

Held (authentication failure)

Enum TEapKeyTag

TEapKeyV6 should be used to request one of (currently) two keys available on the EF_EAPKEYS of the UICC application (see section 7.1 of ETSI TS 102.310 v6.2.0). This enumeration type should be used in RMobileSmartCardEap::GetEapKey() to specify the key to be retrieved.

RMobileSmartCardEap::TEapKeyV6 RMobileSmartCardEap::GetEapKey()

Enumerators

EEapKeyMSK = 0x80

Used to request Master Session Key.

EEapKeyEMSK = 0x81

Used to request Extended Master Session Key.

Enum TEapMethodAccessStatus

Status of the DF_EAP this subsession refers to. The status is basically an indication of whether the DF is in use by another sub- session client instance.

NotifyEapMethodAccessStatusChange() will give a notification when the status changes.

Status will change when the first client calls InitialiseEapMethod() on this sub-session. When the same client calls ReleaseEapMethod() (or Close() ), the status will change again. This allows mutually exclusive access to the DF_EAP. All other RMobileSmartCardEap hanles will get an error if they attempt to make requests that access the same DF_EAP.

RMobileSmartCardEap::NotifyEapMethodAccessStatusChange() RMobileSmartCardEap::ReleaseEapMethod() RMobileSmartCardEap::InitialiseEapMethod()

Enumerators

EEapMethodAvailable

AID/DF_EAP has been reset, and the DF_EAP has not been initialised by any other instance of RMobileSmartCardEap .

EEapMethodInUseApplicationActive

Another instance of RMobileSmartCardEap has initialised first and taken ownership of the DF_EAP. The DF_EAP is currently active and EAP requests can be made.

EEapMethodInUseApplicationInactive

This instance of RMobileSmartCardEap still owns the lock on the DF_EAP, but the application has been deactivated elsewhere. The client should re-initialise before making further EAP requests.

RMobileSmartCardEap::InitialiseEapMethod()

EEapMethodUnableToInitialise

Lock on the DF_EAP has been released, but another DF_EAP method is in use under the same AID, thus, cannot reset/initialise this subsessions EAP method. Client can only post a notification and wait till status changes to EEapMethodAvailable.

RMobileSmartCardEap::NotifyEapMethodAccessStatusChange()

Enum TEapUserIdType

TEapUserIdType should be used to request an identity from EF_PUId or EF_Ps, when making an RMobileSmartCardEap::GetUserIdentity() request. (See sections 7.3 and 7.4, respectively, of ETSI TS 102.310 v6.2.0, and RFC2486 - The Network Access Identifier).

RMobileSmartCardEap::GetUserIdentity() RMobileSmartCardEap::TEapUserIdentityV6

Enumerators

EPermanentIdentity

Identity is permanent type

EPseudonymIdentity

Identity is pseudonym type

Member Type Definitions Documentation

Typedef TEapKeyV6Pckg

typedef TPckg < TEapKeyV6 > TEapKeyV6Pckg

A typedef'd packaged TEapKeyV6 for passing through a generic API method.

Typedef TEapType

typedef TBuf8 < KEapTypeSize > TEapType

A typedef'd buffer to hold the EAP type for the subsequent authentication that will be carried out on the Smart Card Application.

The value specified must correspond to the pre-allocated type identifiers for various EAPs (see http://www.iana.org/assignments/eap-numbers ). Some known values are given in etelmm.h.

The type must be specified in hexadecimal format, where each character represents one semi-octet.

KETelSmartCardEapTypeMD5 KETelSmartCardEapTypeTLS KETelSmartCardEapTypeSIM KETelSmartCardEapTypeAKA KETelSmartCardEapTypeTTLS RMobileSmartCardEap::Open()

Typedef TEapUserIdentityV6Pckg

typedef TPckg < TEapUserIdentityV6 > TEapUserIdentityV6Pckg

A typedef'd packaged TEapUserIdentityV6 for passing through a generic API method.

Member Data Documentation

CMobileSmartCardEapPtrHolder * iMmPtrHolder

CMobileSmartCardEapPtrHolder * iMmPtrHolder [private]

Pointer Holder for the RMobileSmartCardEap sub-session requests.

TBool iOwnsEapMethodLock

TBool iOwnsEapMethodLock [private]

True if this object is the first to request InitialiseEapMethod() on its <AID,EAPType> when the status is EEapMethodAvailable. I.e. True only for the instance of RMobileSmartCardEap that successfully passes the Wait() on iSemaphore.

RSemaphore iSemaphore

RSemaphore iSemaphore [private]

Semaphore is actually owned by TSY, and used by all instances of RMobileSmartCardEap to stop multiple access to the same EAP method on any one application.