secsrv_plat/cms_api/inc/CCMSX509Validity.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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CCMSX509Validity_H
       
    21 #define CCMSX509Validity_H
       
    22 
       
    23 #include "CCMSSequence.h"
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CValidityPeriod;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 /**
       
    30 *  X.509 Validity type module
       
    31 *
       
    32 *  ASN.1 definition:
       
    33 * Validity ::= SEQUENCE {notBefore  Time,
       
    34 *                        notAfter   Time
       
    35 * }
       
    36 *
       
    37 *  @lib cms.lib
       
    38 *  @since 2.8
       
    39 */
       
    40 class CCMSX509Validity : public CCMSSequence
       
    41     {
       
    42 
       
    43     public:  // Constructors and destructor
       
    44 		/**
       
    45         * Two-phased constructor.
       
    46         */
       
    47         IMPORT_C static CCMSX509Validity* NewL();
       
    48 
       
    49         /**
       
    50         * Two-phased constructor.
       
    51         * 
       
    52         * @param aNotBefore notBefore time
       
    53         * @param aNotAfter notAfter time
       
    54         */
       
    55         IMPORT_C static CCMSX509Validity* NewL(
       
    56             const TTime& aNotBefore,
       
    57             const TTime& aNotAfter );
       
    58 
       
    59         /**
       
    60          * Two-phased constructor.
       
    61          *
       
    62          * @param aValidityPeriod CValidityPeriod which the data is copied from.
       
    63          */
       
    64         IMPORT_C static CCMSX509Validity* NewL(
       
    65             const CValidityPeriod& aValidityPeriod );
       
    66         
       
    67         /**
       
    68         * Destructor.
       
    69         */
       
    70         virtual ~CCMSX509Validity();
       
    71 
       
    72     public: // New functions
       
    73 
       
    74         /**
       
    75         * Getter for notBefore.
       
    76         * @since 2.8
       
    77         * @return notBefore time value
       
    78         */
       
    79 		IMPORT_C const TTime& NotBefore() const;
       
    80 
       
    81         /**
       
    82         * Getter for notAfter.
       
    83         * @since 2.8
       
    84         * @return notAfter time value
       
    85         */
       
    86 		IMPORT_C const TTime& NotAfter() const;
       
    87 
       
    88         /**
       
    89         * Setter for notBefore.
       
    90         * @since 2.8
       
    91         * @param aNotBefore notBefore time
       
    92         */
       
    93 		IMPORT_C void
       
    94         SetNotBefore( const TTime& aNotBefore );
       
    95 
       
    96         /**
       
    97         * Setter for notAfter.
       
    98         * @since 2.8
       
    99         * @param aNotAfter notAfter time
       
   100         */
       
   101 		IMPORT_C void SetNotAfter( const TTime& aNotAfter );
       
   102 
       
   103     public: // Functions from base classes
       
   104 
       
   105 	 	/**
       
   106         * From MCMSModule
       
   107         * @since 2.8
       
   108         * @param aRawData raw-data to be parsed in this instance
       
   109         */
       
   110         void DecodeL( const TDesC8& aRawData );
       
   111 
       
   112 	 	/**
       
   113         * From MCMSModule
       
   114         * @since 2.8
       
   115         * @return Returns ASN1 encoder and leaves it in CleanupStack
       
   116         */
       
   117         CASN1EncBase* EncoderLC() const;
       
   118 
       
   119     protected:  // New functions
       
   120 
       
   121         /**
       
   122         * C++ constructor.
       
   123         */
       
   124         IMPORT_C CCMSX509Validity( const TTime& aNotBefore,
       
   125                                    const TTime& aNotAfter );
       
   126 
       
   127         /**
       
   128         * C++ default constructor.
       
   129         */
       
   130         IMPORT_C CCMSX509Validity( );
       
   131 
       
   132     private:    // Data
       
   133         // notBefore
       
   134         TTime iNotBefore;
       
   135 
       
   136         // notAfter
       
   137         TTime iNotAfter;
       
   138         
       
   139     };
       
   140 
       
   141 #endif      // CCMSX509Validity_H
       
   142 
       
   143 // End of File