|
1 /* |
|
2 * Copyright (c) 2003-2009 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 the License "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 |
|
21 /** |
|
22 @file |
|
23 @publishedPartner |
|
24 @released |
|
25 */ |
|
26 |
|
27 #ifndef __PKCS7_ISSUER_AND_SERIAL_NUMBER_H__ |
|
28 #define __PKCS7_ISSUER_AND_SERIAL_NUMBER_H__ |
|
29 |
|
30 #include <e32base.h> |
|
31 |
|
32 class CX500DistinguishedName; |
|
33 class CX509SubjectKeyIdExt; |
|
34 class CASN1EncSequence; |
|
35 class CASN1EncBase; |
|
36 |
|
37 |
|
38 /** |
|
39 The issuer and serial number of a PKCS#7 signature. |
|
40 */ |
|
41 class CPKCS7IssuerAndSerialNumber : public CBase |
|
42 { |
|
43 public: |
|
44 /** |
|
45 * @internalComponent |
|
46 * |
|
47 * Creates a CMS issuer and serial number object as defined in RFC2630 |
|
48 * @param aIssuerName The distinguished name of the issuer. Ownership of |
|
49 * aIssuerName is transferred to the newly created object. |
|
50 * If construction fails, ownership is not transferred. The caller needs to push |
|
51 * aIssuerName onto the cleanup stack before calling this method and pop it off the |
|
52 * cleanup stack after successful construction. |
|
53 * @param aSerialNumber The serial number of the issuer. |
|
54 * @return The fully constructed object. |
|
55 **/ |
|
56 static CPKCS7IssuerAndSerialNumber* NewL(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber); |
|
57 |
|
58 /** |
|
59 * @internalComponent |
|
60 * |
|
61 * Creates a CMS issuer and serial number object as defined in RFC2630 |
|
62 * and leaves it on the cleanup stack. |
|
63 * @param aIssuerName The distinguished name of the issuer. Ownership of |
|
64 * aIssuerName is transferred to the newly created object. |
|
65 * If construction fails, ownership is not transferred. The caller needs to push |
|
66 * aIssuerName onto the cleanup stack before calling this method and pop it off the |
|
67 * cleanup stack after successful construction. |
|
68 * @param aSerialNumber The serial number of the issuer. |
|
69 * @return The fully constructed object. |
|
70 **/ |
|
71 static CPKCS7IssuerAndSerialNumber* NewLC(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber); |
|
72 |
|
73 /** |
|
74 * @internalComponent |
|
75 * |
|
76 * Creates a CMS issuer and serial number object as defined in RFC2630. |
|
77 * @param aRawData A buffer which holds the encoded issuer and serial number. |
|
78 * @return The fully constructed object. |
|
79 **/ |
|
80 static CPKCS7IssuerAndSerialNumber* NewL(const TDesC8& aRawData); |
|
81 |
|
82 /** |
|
83 Destructor. |
|
84 */ |
|
85 IMPORT_C ~CPKCS7IssuerAndSerialNumber(); |
|
86 |
|
87 /** |
|
88 Returns the issuer's distinguished name. |
|
89 @return The issuer's distinguished name reference. |
|
90 */ |
|
91 IMPORT_C const CX500DistinguishedName& IssuerName() const; |
|
92 |
|
93 /** |
|
94 Returns the issuer's serial number. |
|
95 @return The issuer's serial number reference. |
|
96 */ |
|
97 IMPORT_C const TDesC8& SerialNumber() const; |
|
98 |
|
99 /** |
|
100 * @internalComponent |
|
101 * |
|
102 * Creates the ASN1 DER sequence of the signer identifier object |
|
103 * and leaves it on the cleanup stack. |
|
104 * @return ASN1 DER sequence of this object. |
|
105 */ |
|
106 CASN1EncSequence* EncodeASN1DERLC() const; |
|
107 |
|
108 private: |
|
109 /** |
|
110 Constructor |
|
111 */ |
|
112 CPKCS7IssuerAndSerialNumber(void); |
|
113 |
|
114 /** |
|
115 Copy constructor |
|
116 */ |
|
117 CPKCS7IssuerAndSerialNumber(const CPKCS7IssuerAndSerialNumber&); |
|
118 |
|
119 /** |
|
120 Second phase constructor |
|
121 @param aIssuerName the issuer name |
|
122 @param aSerialNumber the serial number |
|
123 */ |
|
124 void ConstructL(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber); |
|
125 |
|
126 /** |
|
127 Second phase constructor |
|
128 @param aRawData the raw data to be decoded. |
|
129 */ |
|
130 void ConstructL(const TDesC8& aRawData); |
|
131 |
|
132 private: |
|
133 /** |
|
134 Signer's distinguished name |
|
135 */ |
|
136 CX500DistinguishedName* iIssuerName; |
|
137 |
|
138 /** |
|
139 Signer's serial number |
|
140 */ |
|
141 HBufC8* iSerialNumber; |
|
142 }; |
|
143 |
|
144 #endif |