First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Symbian specific X509.v3 certificate extensions that constrain the
16 * the devices, secure ids, vendor ids and capabilities for which
17 * a software install signing certificate is valid.
27 #ifndef __X509CONSTRAINTEXT_H__
28 #define __X509CONSTRAINTEXT_H__
31 #include <x509certext.h>
33 class CX509IntListExt : public CX509ExtensionBase
35 A Symbian specific X.509 v3 certificate extension that contains an arbitrary
36 list of 32 bit integers.
44 Creates a new CX509IntListExt object from the binary (DER) encoded
45 representation of a sequence of integers.
47 @param aBinaryData The encoded binary representation.
48 @return The new CX509IntListExt object.
50 IMPORT_C static CX509IntListExt* NewL(const TDesC8& aBinaryData);
53 Creates a new CX509IntListExt object from the binary (DER) encoded
54 representation of a sequence of integers, and puts a pointer to it
55 onto the cleanup stack.
57 @param aBinaryData The encoded binary representation.
58 @return The new CX509IntListExt object.
60 IMPORT_C static CX509IntListExt* NewLC(const TDesC8& aBinaryData);
64 Frees all resources owned by the object.
69 Gets a reference to the array of decoded integers.
70 Ownership is not transferred.
71 @return A reference to the array of decoded integers.
73 IMPORT_C const RArray<TInt>& IntArray() const;
76 /** Second-phase constructor.
78 * @param aBinaryData The encoded binary representation.
79 * @param aPos The position from which to start decoding. */
80 void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
83 Decodes the binary representation of a sequence of integers.
85 @param aBinaryData The encoded binary representation. This is the same as
86 passed to ConstructL().
87 @param aPos The position from which to start decoding. Note that
88 the value passed points, in effect, to the content,
89 bypassing the header data.
91 void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
94 /** The decoded array of integers. */
95 RArray<TInt> iIntArray;
98 class CX509Utf8StringListExt : public CX509ExtensionBase
100 A Symbian specific X.509 v3 certificate extension that contains an arbitrary
101 list of UTF-8 strings.
109 Creates a new CX509Utf8StringListExt object from the binary (DER) encoded
110 representation of a sequence of integers.
112 @param aBinaryData The encoded binary representation.
113 @return The new CX509Utf8StringListExt object.
115 IMPORT_C static CX509Utf8StringListExt* NewL(const TDesC8& aBinaryData);
118 Creates a new CX509Utf8StringListExt object from the binary (DER) encoded
119 representation of a sequence of integers, and puts a pointer to it
120 onto the cleanup stack.
122 @param aBinaryData The encoded binary representation.
123 @return The new CX509Utf8StringListExt object.
125 IMPORT_C static CX509Utf8StringListExt* NewLC(const TDesC8& aBinaryData);
129 Frees all resources owned by the object.
131 ~CX509Utf8StringListExt();
134 Gets a reference to the array of decoded strings (UTF-16).
135 Ownership is not transferred.
136 @return A reference to the array of decoded strings in UTF-16.
138 IMPORT_C const RPointerArray<HBufC>& StringArray() const;
141 /** Second-phase constructor.
142 @param aBinaryData The encoded binary representation.
143 @param aPos The position from which to start decoding.
145 void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
148 Decodes the binary representation of a sequence of UTF-8 strings. The
149 strings are converted and stored internal as UTF-8.
151 @param aBinaryData The encoded binary representation. This is the same as
152 passed to ConstructL().
153 @param aPos The position from which to start decoding. Note that
154 the value passed points, in effect, to the content,
155 bypassing the header data.
157 void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
160 /** The decoded array of strings in UTF-16. */
161 RPointerArray<HBufC> iStringArray;
165 A Symbian specific X.509 v3 certificate extension that contains a capability
166 set encoded as a bit string.
171 class CX509CapabilitySetExt : public CX509ExtensionBase
175 Creates a new CX509CapabilitySetExt object from the binary (DER) encoded
176 representation of a sequence of integers.
178 @param aBinaryData The encoded binary representation.
179 @return The new CX509CapabilitySetExt object.
181 IMPORT_C static CX509CapabilitySetExt* NewL(const TDesC8& aBinaryData);
184 Creates a new CX509CapabilitySetExt object from the binary (DER) encoded
185 representation of a sequence of integers, and puts a pointer to it
186 onto the cleanup stack.
188 @param aBinaryData The encoded binary representation.
189 @return The new CX509CapabilitySetExt object.
191 IMPORT_C static CX509CapabilitySetExt* NewLC(const TDesC8& aBinaryData);
195 Frees all resources owned by the object.
197 ~CX509CapabilitySetExt();
199 /** Gets a reference to the capability set.
200 @return the capability set represented by the bit string.
202 IMPORT_C const TCapabilitySet& CapabilitySet() const;
205 /** Second-phase constructor.
207 @param aBinaryData The encoded binary representation.
208 @param aPos The position from which to start decoding.
210 void ConstructL(const TDesC8& aBinaryData, TInt& aPos);
213 Constructs the a TCapabilitySet from a DER encoded bit string.
215 @param aBinaryData The encoded binary representation. This is the same as
216 passed to ConstructL().
217 @param aPos The position from which to start decoding. Note that
218 the value passed points, in effect, to the content,
219 bypassing the header data.
221 void DoConstructL(const TDesC8& aBinaryData, TInt& aPos);
224 /** The decoded capability set */
225 TCapabilitySet iCapabilitySet;