|
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 CCMSX509SubjectPublicKeyInfo_H |
|
21 #define CCMSX509SubjectPublicKeyInfo_H |
|
22 |
|
23 #include "CCMSSequence.h" |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CCMSX509AlgorithmIdentifier; |
|
27 class CSubjectPublicKeyInfo; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 /** |
|
31 * X.509 SubjectPublicKeyInfo type module |
|
32 * |
|
33 * ASN.1 definition: |
|
34 * SubjectPublicKeyInfo ::= SEQUENCE { |
|
35 * algorithm AlgorithmIdentifier, |
|
36 * subjectPublicKey BIT STRING |
|
37 * } |
|
38 * |
|
39 * @lib cms.lib |
|
40 * @since 2.8 |
|
41 */ |
|
42 class CCMSX509SubjectPublicKeyInfo : public CCMSSequence |
|
43 { |
|
44 |
|
45 public: // Constructors and destructor |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 */ |
|
49 IMPORT_C static CCMSX509SubjectPublicKeyInfo* NewL(); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. Copies of the parameters are made. |
|
53 * |
|
54 * @param aAlgorithm AlgorithmIdentifier |
|
55 * @param aSubjectPublicKey bit string |
|
56 */ |
|
57 IMPORT_C static CCMSX509SubjectPublicKeyInfo* NewL( |
|
58 const CCMSX509AlgorithmIdentifier& aAlgorithm, |
|
59 const TDesC8& aSubjectPublicKey ); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * |
|
64 * @param aSubjectPublicKeyInfo CSubjectPublicKeyInfo which |
|
65 * the data is copied from. |
|
66 */ |
|
67 IMPORT_C static CCMSX509SubjectPublicKeyInfo* NewL( |
|
68 const CSubjectPublicKeyInfo& aSubjectPublicKeyInfo ); |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 virtual ~CCMSX509SubjectPublicKeyInfo(); |
|
74 |
|
75 public: // New functions |
|
76 |
|
77 /** |
|
78 * Getter for algorithm. |
|
79 * @since 2.8 |
|
80 * @return X.509 AlgorithmIdentifier value |
|
81 */ |
|
82 IMPORT_C const CCMSX509AlgorithmIdentifier& Algorithm() const; |
|
83 |
|
84 /** |
|
85 * Getter for subjectPublicKey. |
|
86 * @since 2.8 |
|
87 * @return bit string in a descriptor |
|
88 */ |
|
89 IMPORT_C const TDesC8& SubjectPublicKey() const; |
|
90 |
|
91 /** |
|
92 * Setter for algorithm. Creates a copy. |
|
93 * @since 2.8 |
|
94 * @param aAlgorithm X.509 AlgorithmIdentifier value |
|
95 */ |
|
96 IMPORT_C void |
|
97 SetAlgorithmL( const CCMSX509AlgorithmIdentifier& aAlgorithm ); |
|
98 |
|
99 /** |
|
100 * Setter for subjectPublicKey. |
|
101 * @since 2.8 |
|
102 * @param aSubjectPublicKey bit string |
|
103 */ |
|
104 IMPORT_C void SetSubjectPublicKeyL( const TDesC8& aSubjectPublicKey ); |
|
105 |
|
106 public: // Functions from base classes |
|
107 |
|
108 /** |
|
109 * From MCMSModule |
|
110 * @since 2.8 |
|
111 * @param aRawData raw-data to be parsed in this instance |
|
112 */ |
|
113 void DecodeL( const TDesC8& aRawData ); |
|
114 |
|
115 /** |
|
116 * From MCMSModule |
|
117 * @since 2.8 |
|
118 * @return Returns ASN1 encoder and leaves it in CleanupStack |
|
119 */ |
|
120 CASN1EncBase* EncoderLC() const; |
|
121 |
|
122 protected: // New functions |
|
123 |
|
124 /** |
|
125 * Protected construction to allow derivation |
|
126 */ |
|
127 IMPORT_C void ConstructL( |
|
128 const CCMSX509AlgorithmIdentifier& aAlgorithm, |
|
129 const TDesC8& aSubjectPublicKey ); |
|
130 /** |
|
131 * Protected construction to allow derivation |
|
132 */ |
|
133 IMPORT_C void ConstructL( |
|
134 const CSubjectPublicKeyInfo& aSubjectPublicKeyInfo ); |
|
135 |
|
136 /** |
|
137 * Protected construction to allow derivation |
|
138 */ |
|
139 IMPORT_C void ConstructL( ); |
|
140 |
|
141 /** |
|
142 * C++ default constructor. |
|
143 */ |
|
144 IMPORT_C CCMSX509SubjectPublicKeyInfo( ); |
|
145 |
|
146 private: // Data |
|
147 // AlgorithmIdentifier, owned |
|
148 CCMSX509AlgorithmIdentifier* iAlgorithm; |
|
149 |
|
150 // subjectPublicKey, owned |
|
151 HBufC8* iSubjectPublicKey; |
|
152 |
|
153 }; |
|
154 |
|
155 #endif // CCMSX509SubjectPublicKeyInfo_H |
|
156 |
|
157 // End of File |