javaextensions/satsa/apdu/src.s60/cstsprincipal.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 CSTSPRINCIPAL_H
       
    20 #define CSTSPRINCIPAL_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "mstsasn1module.h"
       
    25 
       
    26 namespace java
       
    27 {
       
    28 namespace satsa
       
    29 {
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33  *  Principal type module
       
    34  *
       
    35  *  ASN.1 Definition:
       
    36  *  Principal ::= CHOICE {
       
    37  *      rootID [0]PrincipalID,
       
    38  *      endEntityID [1]PrincipalID,
       
    39  *      domain [2]Domain, -- Operator, manufacturer or Trusted Third Party
       
    40  *      ... -- for future extensions
       
    41  *  }
       
    42  *  PrincipalID ::= OCTET STRING (SIZE(20))
       
    43  *  - SHA-1 hash of the domain certificate
       
    44  *  Domain ::= OBJECT IDENTIFIER
       
    45  *
       
    46  */
       
    47 NONSHARABLE_CLASS(CSTSPrincipal): public CBase, MSTSASN1Module
       
    48 {
       
    49 public: // data types
       
    50     enum TType
       
    51     {
       
    52         ERootID = 0,
       
    53         EEndEntityID = 1,
       
    54         EDomain = 2
       
    55     };
       
    56 public: // Constructors and destructor
       
    57     /**
       
    58      * Two-phased constructor.
       
    59      */
       
    60     static CSTSPrincipal* NewLC();
       
    61 
       
    62     /**
       
    63      * Destructor.
       
    64      */
       
    65     virtual ~CSTSPrincipal();
       
    66 
       
    67 public: // New functions
       
    68 
       
    69     /**
       
    70      * Getter for principal type
       
    71      * @since 3.0
       
    72      * @return principal type
       
    73      */
       
    74     CSTSPrincipal::TType Type() const;
       
    75 
       
    76     /**
       
    77      * Getter for principal ID
       
    78      * @since 3.0
       
    79      * @return principal ID in TDesC reference
       
    80      */
       
    81     const TDesC8& PrincipalID() const;
       
    82 
       
    83     /**
       
    84      * Getter for domain
       
    85      * @since 3.0
       
    86      * @return domain in TDesC reference
       
    87      */
       
    88     const TDesC& Domain() const;
       
    89 
       
    90 public: // Functions from base classes
       
    91 
       
    92     /**
       
    93      * From MSTSASN1Module
       
    94      * @since 3.0
       
    95      * @param aRawData raw-data to be parsed in this instance
       
    96      */
       
    97     void DecodeL(const TDesC8& aRawData);
       
    98 
       
    99 protected: // New functions
       
   100 
       
   101     /**
       
   102      * Protected construction to allow derivation
       
   103      */
       
   104     void ConstructL();
       
   105 
       
   106     /**
       
   107      * C++ default constructor.
       
   108      */
       
   109     CSTSPrincipal();
       
   110 
       
   111 protected: // Data
       
   112     // type of the choice
       
   113     TType iType;
       
   114     // rootID or endEntityID depending on type of choice, owned
       
   115     HBufC8* iPrincipalID;
       
   116     // domain object identifier, owned
       
   117     HBufC* iDomain;
       
   118 };
       
   119 
       
   120 } // namespace satsa
       
   121 } // namespace java
       
   122 #endif // CSTSPRINCIPAL_H
       
   123 // End of File