|
1 /* |
|
2 * Copyright (c) 2002 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 CCMSX509AlgorithmIdentifier_H |
|
21 #define CCMSX509AlgorithmIdentifier_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "CCMSSequence.h" |
|
25 #include <signed.h> |
|
26 #include <x509cert.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 // Extension |
|
30 class MCMSX509AlgorithmIdentifier; |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * X509 algorith identifier extension |
|
36 * |
|
37 * @lib cms.lib |
|
38 * @since 2.8 |
|
39 */ |
|
40 class CCMSX509AlgorithmIdentifier : public CCMSSequence |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * Default Algorith Identifier is RSA |
|
46 */ |
|
47 IMPORT_C static CCMSX509AlgorithmIdentifier* NewL(); |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 * @param aAlgorithmId Used AlgorithmID |
|
52 */ |
|
53 IMPORT_C static CCMSX509AlgorithmIdentifier* NewL( |
|
54 const TAlgorithmId& aAlgorithmId ); |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. |
|
58 * @param aAlgorithmIdentifier The algorithm ID object to be used |
|
59 */ |
|
60 IMPORT_C static CCMSX509AlgorithmIdentifier* NewL( |
|
61 const CAlgorithmIdentifier& aAlgorithmIdentifier ); |
|
62 |
|
63 /** |
|
64 * Two-phased constructor. |
|
65 * @param aAlgorithmIdentifier The algorithm ID for algorithm |
|
66 * @param aDigestIdentifier The algorithm ID for digest |
|
67 */ |
|
68 IMPORT_C static CCMSX509AlgorithmIdentifier* NewL( |
|
69 const CAlgorithmIdentifier& aAlgorithmIdentifier, |
|
70 const CAlgorithmIdentifier& aDigestIdentifier ); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 virtual ~CCMSX509AlgorithmIdentifier(); |
|
76 |
|
77 public: // New functions |
|
78 |
|
79 /** |
|
80 * Getter for AlgorithmIdentifier |
|
81 * @since 2,8 |
|
82 * @return Algorithm identifier |
|
83 */ |
|
84 IMPORT_C const CAlgorithmIdentifier& AlgorithmIdentifier() const; |
|
85 |
|
86 /** |
|
87 * Setter for AlgorithmIdentifier |
|
88 * @since 2.8 |
|
89 * @param aAlgorithmIdentifier The algorithm ID |
|
90 */ |
|
91 IMPORT_C void SetAlgorithmIdentifierL( |
|
92 const CAlgorithmIdentifier& aAlgorithmIdentifier ); |
|
93 |
|
94 /** |
|
95 * Getter for DigestAlgorithmIdentifier |
|
96 * @since 2,8 |
|
97 * @return Digest algorithm identifier or NULL if absent |
|
98 */ |
|
99 IMPORT_C const CAlgorithmIdentifier* DigestAlgorithm() const; |
|
100 |
|
101 /** |
|
102 * Setter for DigestAlgorithmIdentifier |
|
103 * @since 2.8 |
|
104 * @param aAlgorithmIdentifier The algorithm ID for digest or NULL if |
|
105 * removing digest algorithm ID |
|
106 */ |
|
107 IMPORT_C void SetDigestAlgorithmL( |
|
108 const CAlgorithmIdentifier* aAlgorithmIdentifier ); |
|
109 |
|
110 public: // Functions from base classes |
|
111 |
|
112 /** |
|
113 * From MCMSModule |
|
114 * @since 2.8 |
|
115 * @param aRawData raw-data to be parsed in this instance |
|
116 */ |
|
117 void DecodeL( const TDesC8& aRawData ); |
|
118 |
|
119 /** |
|
120 * From MCMSModule |
|
121 * @since 2.8 |
|
122 * @return Returns ASN1 encoder and leaves it in CleanupStack |
|
123 */ |
|
124 CASN1EncBase* EncoderLC() const; |
|
125 |
|
126 protected: // New functions |
|
127 |
|
128 /** |
|
129 * Protected construction to allow derivation |
|
130 */ |
|
131 IMPORT_C void ConstructL( const TAlgorithmId& aAlgorihmId ); |
|
132 |
|
133 /** |
|
134 * Protected construction to allow derivation |
|
135 */ |
|
136 IMPORT_C void ConstructL( const CAlgorithmIdentifier& aAlgorithmIdentifier ); |
|
137 |
|
138 /** |
|
139 * C++ default constructor. |
|
140 */ |
|
141 IMPORT_C CCMSX509AlgorithmIdentifier(); |
|
142 |
|
143 private: // Data |
|
144 // Algorithm identifier, owned |
|
145 CAlgorithmIdentifier* iAlgorithmIdentifier; |
|
146 |
|
147 // Digest algorithm identifier, owned |
|
148 CAlgorithmIdentifier* iDigestAlgorithmIdentifier; |
|
149 |
|
150 // Reserved for extensions |
|
151 MCMSX509AlgorithmIdentifier* iReserved; |
|
152 }; |
|
153 |
|
154 #endif // CCMSX509AlgorithmIdentifier_H |
|
155 |
|
156 // End of File |