secsrv_plat/cms_api/inc/CCMSOriginatorInfo.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 /*
       
     2 * Copyright (c) 2004 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCMSOriginatorInfo_H
       
    21 #define CCMSOriginatorInfo_H
       
    22 
       
    23 #include "CCMSSequence.h"
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class CCMSCertificateChoices;
       
    27 class CCMSX509CertificateList;
       
    28 
       
    29 // CLASS DECLARATION
       
    30 /**
       
    31 *  CMS OriginatorInfo type module
       
    32 *
       
    33 *  ASN.1 definition:
       
    34 *      OriginatorInfo ::= SEQUENCE {
       
    35 *        certs [0] IMPLICIT CertificateSet OPTIONAL,
       
    36 *        crls [1] IMPLICIT CertificateRevocationLists OPTIONAL } 
       
    37 *
       
    38 *      CertificateSet ::= SET OF CertificateChoices
       
    39 *
       
    40 *      CertificateRevocationLists ::= SET OF CertificateList
       
    41 *
       
    42 *  @lib cms.lib
       
    43 *  @since 2.8
       
    44 */
       
    45 class CCMSOriginatorInfo : public CCMSSequence
       
    46     {
       
    47 
       
    48     public:  // Constructors and destructor
       
    49 		/**
       
    50         * Two-phased constructor.
       
    51         */
       
    52         IMPORT_C static CCMSOriginatorInfo* NewL();
       
    53 
       
    54         /**
       
    55         * Destructor.
       
    56         */
       
    57         virtual ~CCMSOriginatorInfo();
       
    58 
       
    59     public: // New functions
       
    60 
       
    61         /**
       
    62         * Getter for certs.
       
    63         * @since 2.8
       
    64         * @return CertificateSet or NULL
       
    65         */
       
    66 		IMPORT_C const CArrayPtr< CCMSCertificateChoices >* Certs() const;
       
    67 
       
    68         /**
       
    69         * Getter for crls.
       
    70         * @since 2.8
       
    71         * @return CertificateRevocationLists or NULL
       
    72         */
       
    73 		IMPORT_C const CArrayPtr< CCMSX509CertificateList >* Crls() const;
       
    74 
       
    75         /**
       
    76         * Setter for certs. Takes ownership.
       
    77         * @since 2.8
       
    78         * @param aCerts CertificateSet
       
    79         */
       
    80 		IMPORT_C void
       
    81         SetCerts( CArrayPtr< CCMSCertificateChoices >* aCerts );
       
    82 
       
    83         /**
       
    84         * Setter for crls. Takes ownership.
       
    85         * @since 2.8
       
    86         * @param aCrls CertificateRevocationLists
       
    87         */
       
    88 		IMPORT_C void
       
    89         SetCrls( CArrayPtr< CCMSX509CertificateList >* aCrls );
       
    90 
       
    91         /**
       
    92          * Decoder method with implicit tag checking.
       
    93          * @since 2.8
       
    94          * @param aRawData raw-data to be parsed in this instance
       
    95          * @param aImplicitTag tag to be checked
       
    96          */
       
    97         void DecodeImplicitTagL( const TDesC8& aRawData,
       
    98                                  const TTagType aImplicitTag );         
       
    99         
       
   100     public: // Functions from base classes
       
   101 
       
   102 	 	/**
       
   103         * From MCMSModule
       
   104         * @since 2.8
       
   105         * @param aRawData raw-data to be parsed in this instance
       
   106         */
       
   107         void DecodeL( const TDesC8& aRawData );
       
   108 
       
   109 	 	/**
       
   110         * From MCMSModule
       
   111         * @since 2.8
       
   112         * @return Returns ASN1 encoder and leaves it in CleanupStack
       
   113         */
       
   114         CASN1EncBase* EncoderLC() const;
       
   115 
       
   116     protected:  // New functions
       
   117 
       
   118         /**
       
   119         * C++ default constructor.
       
   120         */
       
   121         IMPORT_C CCMSOriginatorInfo( );
       
   122 
       
   123     private: // New Methods
       
   124 
       
   125         /**
       
   126          * Decodes internal data from a array of ASN.1 decoders
       
   127          * @param aItems items to internalize
       
   128          */
       
   129         void DecodeArrayL( CArrayPtr< TASN1DecGeneric >* aItems );
       
   130         
       
   131     private:    // Data
       
   132         // certs, owned
       
   133         CArrayPtr< CCMSCertificateChoices >* iCerts;
       
   134 
       
   135         // crls, owned
       
   136         CArrayPtr< CCMSX509CertificateList >* iCrls;
       
   137         
       
   138     };
       
   139 
       
   140 #endif      // CCMSOriginatorInfo_H
       
   141 
       
   142 // End of File