javaextensions/satsa/apdu/src.s60/cstsuserauth.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 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 "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  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CSTSUSERAUTH_H
       
    20 #define CSTSUSERAUTH_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <badesca.h>
       
    24 #include "cstsasn1sequence.h"
       
    25 
       
    26 namespace java
       
    27 {
       
    28 namespace satsa
       
    29 {
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  *  UserAuthentication type module
       
    34  *
       
    35  *  ASN.1 Definition:
       
    36  *  UserAuthentication ::= SEQUENCE {
       
    37  *      authID OCTET STRING,
       
    38  *      userAuthenticationMethod UserAuthenticationMethod,
       
    39  *      ... -- for future extensions
       
    40  *  }
       
    41  *  UserAuthenticationMethod ::= CHOICE {
       
    42  *      apduPinEntry [0]APDUPinEntry,
       
    43  *      jcrmiPinEntry [1]JCRMIPinEntry,
       
    44  *      ... -- for future extensions
       
    45  *      }
       
    46  *  APDUPinEntry ::= SEQUENCE {
       
    47  *      verifyPinAPDU [0]APDUHeader OPTIONAL,
       
    48  *      changePinAPDU [1]APDUHeader OPTIONAL,
       
    49  *      disablePinAPDU [2]APDUHeader OPTIONAL,
       
    50  *      enablePinAPDU [3]APDUHeader OPTIONAL,
       
    51  *      unblockPinAPDU [4]APDUHeader OPTIONAL,
       
    52  *      ... -- for future extensions
       
    53  *  }
       
    54  *
       
    55  *  @since 3.0
       
    56  */
       
    57 NONSHARABLE_CLASS(CSTSUserAuth): public CSTSASN1Sequence
       
    58 {
       
    59 public: // data types
       
    60     enum TType
       
    61     {
       
    62         EAPDUPinEntry = 0,
       
    63         EOther = 1,
       
    64         ENotInitialized = 2
       
    65     };
       
    66 public: // Constructors and destructor
       
    67     /**
       
    68      * Two-phased constructor.
       
    69      * NOTE: Encrypt will leave with KErrBadDescriptor if
       
    70      * valid authentication ID has not setted.
       
    71      */
       
    72     static CSTSUserAuth* NewLC();
       
    73 
       
    74     virtual ~CSTSUserAuth();
       
    75 
       
    76 public: // New functions
       
    77 
       
    78     /**
       
    79      * Getter for authentication method type
       
    80      * @return type
       
    81      */
       
    82     TType Type() const;
       
    83 
       
    84     /**
       
    85      * Getter for authentication ID
       
    86      * @return authentication ID in TDesC reference
       
    87      */
       
    88     const TDesC8& AuthId() const;
       
    89 
       
    90     /**
       
    91      * Getter for apdu PIN headers
       
    92      * @return apdu PIN headers in CDesC8ArrayFlat reference
       
    93      */
       
    94     const CDesC8ArrayFlat& ApduPinHeaders() const;
       
    95 
       
    96 public: // Functions from base classes
       
    97 
       
    98     /**
       
    99      * From MSTSASN1Module
       
   100      * @param aRawData raw-data to be parsed in this instance
       
   101      */
       
   102     void DecodeL(const TDesC8& aRawData);
       
   103 
       
   104 protected: // New functions
       
   105 
       
   106     void ConstructL();
       
   107 
       
   108     CSTSUserAuth();
       
   109 
       
   110 protected: // Data
       
   111     // type of the choice
       
   112     TType iType;
       
   113     // Authentication ID, owned
       
   114     HBufC8* iAuthId;
       
   115     // apdu PIN headers, owned
       
   116     CDesC8ArrayFlat* iApduPinHeaders;
       
   117 
       
   118 };
       
   119 
       
   120 } // namespace satsa
       
   121 } // namespace java
       
   122 #endif // CSTSUSERAUTH_H
       
   123 // End of File