]>
Commit | Line | Data |
---|---|---|
bac41a7b A |
1 | // NOTE: this is a machine generated file--editing not recommended |
2 | // | |
3 | // sm_x509af.h - class definitions for ASN.1 module AuthenticationFramework | |
4 | // | |
29654253 | 5 | // This file was generated by snacc on Mon Apr 22 22:34:19 2002 |
bac41a7b A |
6 | // UBC snacc by Mike Sample |
7 | // A couple of enhancements made by IBM European Networking Center | |
8 | ||
9 | #ifndef _sm_x509af_h_ | |
10 | #define _sm_x509af_h_ | |
11 | ||
12 | ||
13 | //------------------------------------------------------------------------------ | |
14 | // class declarations: | |
15 | ||
16 | class Version; | |
17 | class AttributeCertificateAssertionSetOf; | |
18 | class AttributeCertificateInfoSeqOf; | |
19 | class AlgorithmIdentifier; | |
20 | class Time; | |
21 | class Extension; | |
22 | class AttCertValidityPeriod; | |
23 | class Validity; | |
24 | class SubjectPublicKeyInfo; | |
25 | class Extensions; | |
26 | class IssuerSerial; | |
27 | class AttributeCertificateAssertionChoice; | |
28 | class AttributeCertificateInfoChoice; | |
29 | class CRLToSignSeqOfSeq; | |
30 | class CRLToSignSeqOf; | |
31 | class CertificateToSign; | |
32 | class CRLToSign; | |
33 | class AttributeCertificateInfo; | |
34 | class Certificate; | |
35 | class CrossCertificates; | |
36 | class CertificatePair; | |
37 | class CertificateList; | |
38 | class AttributeCertificate; | |
39 | class CertificationPathSeqOf; | |
40 | class ForwardCertificationPath; | |
41 | class ACPathData; | |
42 | class AttributeCertificationPathSeqOf; | |
43 | class Certificates; | |
44 | class CertificationPath; | |
45 | class AttributeCertificationPath; | |
46 | class AttributeCertificateAssertion; | |
47 | ||
48 | //------------------------------------------------------------------------------ | |
49 | // class definitions: | |
50 | ||
51 | typedef enum AuthenticationFrameworkAnyId | |
52 | { | |
53 | ||
54 | } AuthenticationFrameworkAnyId; | |
55 | ||
56 | ||
57 | /* INTEGER { v1 (0), v2 (1), v3 (2) } */ | |
58 | class Version: public AsnInt | |
59 | { | |
60 | public: | |
61 | Version(): AsnInt() {} | |
62 | Version (int i): AsnInt (i) {} | |
63 | enum | |
64 | { | |
65 | v1 = 0, | |
66 | v2 = 1, | |
67 | v3 = 2 | |
68 | }; | |
69 | }; | |
70 | ||
71 | ||
72 | /* OCTET STRING (SIZE (0..ub-password-length)) */ | |
73 | typedef AsnOcts UserPassword; | |
74 | ||
75 | class AttributeCertificateAssertionSetOf: public AsnType | |
76 | { | |
77 | protected: | |
78 | unsigned long int count; | |
79 | struct AsnListElmt | |
80 | { | |
81 | AsnListElmt *next; | |
82 | AsnListElmt *prev; | |
83 | AttributeType *elmt; | |
84 | } *first, *curr, *last; | |
85 | ||
86 | public: | |
87 | AttributeCertificateAssertionSetOf() { count = 0; first = curr = last = NULL; } | |
88 | AttributeCertificateAssertionSetOf (const AttributeCertificateAssertionSetOf &); | |
89 | virtual ~AttributeCertificateAssertionSetOf(); | |
90 | virtual AsnType *Clone() const; | |
91 | ||
92 | virtual AsnType *Copy() const; | |
93 | ||
94 | AttributeCertificateAssertionSetOf &operator = (const AttributeCertificateAssertionSetOf &); | |
95 | void SetCurrElmt (unsigned long int index); | |
96 | unsigned long int GetCurrElmtIndex(); | |
97 | void SetCurrToFirst() { curr = first; } | |
98 | void SetCurrToLast() { curr = last; } | |
99 | // reading member fcns | |
100 | int Count() const { return count; } | |
101 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
102 | AttributeType *First() const { return count > 0 ? first->elmt : NULL; } | |
103 | AttributeType *Last() const { return count > 0 ? last->elmt : NULL; } | |
104 | AttributeType *Curr() const { return curr ? curr->elmt : NULL; } | |
105 | AttributeType *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
106 | AttributeType *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
107 | ||
108 | // routines that move the curr elmt | |
109 | AttributeType *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
110 | AttributeType *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
111 | ||
112 | // write & alloc fcns - returns new elmt | |
113 | AttributeType *Append(); // add elmt to end of list | |
114 | AttributeType *Prepend(); // add elmt to beginning of list | |
115 | AttributeType *InsertBefore(); //insert elmt before current elmt | |
116 | AttributeType *InsertAfter(); //insert elmt after current elmt | |
117 | ||
118 | // write & alloc & copy - returns list after copying elmt | |
119 | AttributeCertificateAssertionSetOf &AppendCopy (AttributeType &elmt); // add elmt to end of list | |
120 | AttributeCertificateAssertionSetOf &PrependCopy (AttributeType &elmt); // add elmt to beginning of list | |
121 | AttributeCertificateAssertionSetOf &InsertBeforeAndCopy (AttributeType &elmt); //insert elmt before current elmt | |
122 | AttributeCertificateAssertionSetOf &InsertAfterAndCopy (AttributeType &elmt); //insert elmt after current elmt | |
123 | ||
124 | // removing the current elmt from the list | |
125 | void RemoveCurrFromList(); | |
126 | ||
127 | // encode and decode routines | |
128 | AsnLen BEnc (BUF_TYPE b); | |
129 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
130 | AsnLen BEncContent (BUF_TYPE b); | |
131 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
132 | ||
133 | PDU_MEMBER_MACROS | |
134 | void Print (ostream &os) const; | |
135 | }; | |
136 | ||
137 | ||
138 | class AttributeCertificateInfoSeqOf: public AsnType | |
139 | { | |
140 | protected: | |
141 | unsigned long int count; | |
142 | struct AsnListElmt | |
143 | { | |
144 | AsnListElmt *next; | |
145 | AsnListElmt *prev; | |
146 | Attribute *elmt; | |
147 | } *first, *curr, *last; | |
148 | ||
149 | public: | |
150 | AttributeCertificateInfoSeqOf() { count = 0; first = curr = last = NULL; } | |
151 | AttributeCertificateInfoSeqOf (const AttributeCertificateInfoSeqOf &); | |
152 | virtual ~AttributeCertificateInfoSeqOf(); | |
153 | virtual AsnType *Clone() const; | |
154 | ||
155 | virtual AsnType *Copy() const; | |
156 | ||
157 | AttributeCertificateInfoSeqOf &operator = (const AttributeCertificateInfoSeqOf &); | |
158 | void SetCurrElmt (unsigned long int index); | |
159 | unsigned long int GetCurrElmtIndex(); | |
160 | void SetCurrToFirst() { curr = first; } | |
161 | void SetCurrToLast() { curr = last; } | |
162 | // reading member fcns | |
163 | int Count() const { return count; } | |
164 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
165 | Attribute *First() const { return count > 0 ? first->elmt : NULL; } | |
166 | Attribute *Last() const { return count > 0 ? last->elmt : NULL; } | |
167 | Attribute *Curr() const { return curr ? curr->elmt : NULL; } | |
168 | Attribute *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
169 | Attribute *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
170 | ||
171 | // routines that move the curr elmt | |
172 | Attribute *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
173 | Attribute *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
174 | ||
175 | // write & alloc fcns - returns new elmt | |
176 | Attribute *Append(); // add elmt to end of list | |
177 | Attribute *Prepend(); // add elmt to beginning of list | |
178 | Attribute *InsertBefore(); //insert elmt before current elmt | |
179 | Attribute *InsertAfter(); //insert elmt after current elmt | |
180 | ||
181 | // write & alloc & copy - returns list after copying elmt | |
182 | AttributeCertificateInfoSeqOf &AppendCopy (Attribute &elmt); // add elmt to end of list | |
183 | AttributeCertificateInfoSeqOf &PrependCopy (Attribute &elmt); // add elmt to beginning of list | |
184 | AttributeCertificateInfoSeqOf &InsertBeforeAndCopy (Attribute &elmt); //insert elmt before current elmt | |
185 | AttributeCertificateInfoSeqOf &InsertAfterAndCopy (Attribute &elmt); //insert elmt after current elmt | |
186 | ||
187 | // removing the current elmt from the list | |
188 | void RemoveCurrFromList(); | |
189 | ||
190 | // encode and decode routines | |
191 | AsnLen BEnc (BUF_TYPE b); | |
192 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
193 | AsnLen BEncContent (BUF_TYPE b); | |
194 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
195 | ||
196 | PDU_MEMBER_MACROS | |
197 | void Print (ostream &os) const; | |
198 | }; | |
199 | ||
200 | ||
201 | /* BigIntegerStr */ | |
202 | typedef BigIntegerStr CertificateSerialNumber; | |
203 | ||
204 | class AlgorithmIdentifier: public AsnType | |
205 | { | |
206 | public: | |
207 | AsnOid algorithm; | |
208 | AsnAny *parameters; | |
209 | ||
210 | AlgorithmIdentifier(); | |
211 | AlgorithmIdentifier (const AlgorithmIdentifier &); | |
212 | virtual ~AlgorithmIdentifier(); | |
213 | virtual AsnType *Clone() const; | |
214 | ||
215 | virtual AsnType *Copy() const; | |
216 | ||
217 | AlgorithmIdentifier &operator = (const AlgorithmIdentifier &); | |
218 | AsnLen BEncContent (BUF_TYPE b); | |
219 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
220 | ||
221 | AsnLen BEnc (BUF_TYPE b); | |
222 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
223 | void Print (ostream &os) const; |
224 | }; | |
225 | ||
226 | ||
227 | class Time: public AsnType | |
228 | { | |
229 | public: | |
230 | enum ChoiceIdEnum | |
231 | { | |
232 | utcTimeCid = 0, | |
233 | generalizedTimeCid = 1 | |
234 | }; | |
235 | ||
236 | enum ChoiceIdEnum choiceId; | |
237 | union | |
238 | { | |
239 | UTCTime *utcTime; | |
240 | GeneralizedTime *generalizedTime; | |
241 | }; | |
242 | ||
243 | ||
244 | Time(); | |
245 | Time (const Time &); | |
246 | virtual ~Time(); | |
247 | ||
248 | virtual AsnType *Clone() const; | |
249 | ||
250 | virtual AsnType *Copy() const; | |
251 | ||
252 | Time &operator = (const Time &); | |
253 | AsnLen BEncContent (BUF_TYPE b); | |
254 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
255 | AsnLen BEnc (BUF_TYPE b); | |
256 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
257 | void Print (ostream &os) const; |
258 | }; | |
259 | ||
260 | ||
261 | class Extension: public AsnType | |
262 | { | |
263 | public: | |
264 | AsnOid extnId; | |
265 | AsnBool *critical; | |
266 | AsnOcts extnValue; | |
267 | ||
268 | Extension(); | |
269 | Extension (const Extension &); | |
270 | virtual ~Extension(); | |
271 | virtual AsnType *Clone() const; | |
272 | ||
273 | virtual AsnType *Copy() const; | |
274 | ||
275 | Extension &operator = (const Extension &); | |
276 | AsnLen BEncContent (BUF_TYPE b); | |
277 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
278 | ||
279 | AsnLen BEnc (BUF_TYPE b); | |
280 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
281 | void Print (ostream &os) const; |
282 | }; | |
283 | ||
284 | ||
285 | class AttCertValidityPeriod: public AsnType | |
286 | { | |
287 | public: | |
288 | GeneralizedTime notBeforeTime; | |
289 | GeneralizedTime notAfterTime; | |
290 | ||
291 | AttCertValidityPeriod(); | |
292 | AttCertValidityPeriod (const AttCertValidityPeriod &); | |
293 | virtual ~AttCertValidityPeriod(); | |
294 | virtual AsnType *Clone() const; | |
295 | ||
296 | virtual AsnType *Copy() const; | |
297 | ||
298 | AttCertValidityPeriod &operator = (const AttCertValidityPeriod &); | |
299 | AsnLen BEncContent (BUF_TYPE b); | |
300 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
301 | ||
302 | AsnLen BEnc (BUF_TYPE b); | |
303 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
304 | void Print (ostream &os) const; |
305 | }; | |
306 | ||
307 | ||
308 | class Validity: public AsnType | |
309 | { | |
310 | public: | |
311 | Time *notBefore; | |
312 | Time *notAfter; | |
313 | ||
314 | Validity(); | |
315 | Validity (const Validity &); | |
316 | virtual ~Validity(); | |
317 | virtual AsnType *Clone() const; | |
318 | ||
319 | virtual AsnType *Copy() const; | |
320 | ||
321 | Validity &operator = (const Validity &); | |
322 | AsnLen BEncContent (BUF_TYPE b); | |
323 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
324 | ||
325 | AsnLen BEnc (BUF_TYPE b); | |
326 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
327 | void Print (ostream &os) const; |
328 | }; | |
329 | ||
330 | ||
331 | class SubjectPublicKeyInfo: public AsnType | |
332 | { | |
333 | public: | |
334 | AlgorithmIdentifier *algorithm; | |
335 | AsnBits subjectPublicKey; | |
336 | ||
337 | SubjectPublicKeyInfo(); | |
338 | SubjectPublicKeyInfo (const SubjectPublicKeyInfo &); | |
339 | virtual ~SubjectPublicKeyInfo(); | |
340 | virtual AsnType *Clone() const; | |
341 | ||
342 | virtual AsnType *Copy() const; | |
343 | ||
344 | SubjectPublicKeyInfo &operator = (const SubjectPublicKeyInfo &); | |
345 | AsnLen BEncContent (BUF_TYPE b); | |
346 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
347 | ||
348 | AsnLen BEnc (BUF_TYPE b); | |
349 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
350 | void Print (ostream &os) const; |
351 | }; | |
352 | ||
353 | ||
354 | class Extensions: public AsnType | |
355 | { | |
356 | protected: | |
357 | unsigned long int count; | |
358 | struct AsnListElmt | |
359 | { | |
360 | AsnListElmt *next; | |
361 | AsnListElmt *prev; | |
362 | Extension *elmt; | |
363 | } *first, *curr, *last; | |
364 | ||
365 | public: | |
366 | Extensions() { count = 0; first = curr = last = NULL; } | |
367 | Extensions (const Extensions &); | |
368 | virtual ~Extensions(); | |
369 | virtual AsnType *Clone() const; | |
370 | ||
371 | virtual AsnType *Copy() const; | |
372 | ||
373 | Extensions &operator = (const Extensions &); | |
374 | void SetCurrElmt (unsigned long int index); | |
375 | unsigned long int GetCurrElmtIndex(); | |
376 | void SetCurrToFirst() { curr = first; } | |
377 | void SetCurrToLast() { curr = last; } | |
378 | // reading member fcns | |
379 | int Count() const { return count; } | |
380 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
381 | Extension *First() const { return count > 0 ? first->elmt : NULL; } | |
382 | Extension *Last() const { return count > 0 ? last->elmt : NULL; } | |
383 | Extension *Curr() const { return curr ? curr->elmt : NULL; } | |
384 | Extension *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
385 | Extension *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
386 | ||
387 | // routines that move the curr elmt | |
388 | Extension *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
389 | Extension *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
390 | ||
391 | // write & alloc fcns - returns new elmt | |
392 | Extension *Append(); // add elmt to end of list | |
393 | Extension *Prepend(); // add elmt to beginning of list | |
394 | Extension *InsertBefore(); //insert elmt before current elmt | |
395 | Extension *InsertAfter(); //insert elmt after current elmt | |
396 | ||
397 | // write & alloc & copy - returns list after copying elmt | |
398 | Extensions &AppendCopy (Extension &elmt); // add elmt to end of list | |
399 | Extensions &PrependCopy (Extension &elmt); // add elmt to beginning of list | |
400 | Extensions &InsertBeforeAndCopy (Extension &elmt); //insert elmt before current elmt | |
401 | Extensions &InsertAfterAndCopy (Extension &elmt); //insert elmt after current elmt | |
402 | ||
403 | // removing the current elmt from the list | |
404 | void RemoveCurrFromList(); | |
405 | ||
406 | // encode and decode routines | |
407 | AsnLen BEnc (BUF_TYPE b); | |
408 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
409 | AsnLen BEncContent (BUF_TYPE b); | |
410 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
411 | ||
412 | PDU_MEMBER_MACROS | |
413 | void Print (ostream &os) const; | |
414 | }; | |
415 | ||
416 | ||
417 | class IssuerSerial: public AsnType | |
418 | { | |
419 | public: | |
420 | GeneralNames issuer; | |
421 | CertificateSerialNumber serial; | |
422 | UniqueIdentifier *issuerUID; | |
423 | ||
424 | IssuerSerial(); | |
425 | IssuerSerial (const IssuerSerial &); | |
426 | virtual ~IssuerSerial(); | |
427 | virtual AsnType *Clone() const; | |
428 | ||
429 | virtual AsnType *Copy() const; | |
430 | ||
431 | IssuerSerial &operator = (const IssuerSerial &); | |
432 | AsnLen BEncContent (BUF_TYPE b); | |
433 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
434 | ||
435 | AsnLen BEnc (BUF_TYPE b); | |
436 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
437 | void Print (ostream &os) const; |
438 | }; | |
439 | ||
440 | ||
441 | class AttributeCertificateAssertionChoice: public AsnType | |
442 | { | |
443 | public: | |
444 | enum ChoiceIdEnum | |
445 | { | |
446 | baseCertificateIDCid = 0, | |
447 | subjectNameCid = 1 | |
448 | }; | |
449 | ||
450 | enum ChoiceIdEnum choiceId; | |
451 | union | |
452 | { | |
453 | IssuerSerial *baseCertificateID; | |
454 | Name *subjectName; | |
455 | }; | |
456 | ||
457 | ||
458 | AttributeCertificateAssertionChoice(); | |
459 | AttributeCertificateAssertionChoice (const AttributeCertificateAssertionChoice &); | |
460 | virtual ~AttributeCertificateAssertionChoice(); | |
461 | ||
462 | virtual AsnType *Clone() const; | |
463 | ||
464 | virtual AsnType *Copy() const; | |
465 | ||
466 | AttributeCertificateAssertionChoice &operator = (const AttributeCertificateAssertionChoice &); | |
467 | AsnLen BEncContent (BUF_TYPE b); | |
468 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
469 | AsnLen BEnc (BUF_TYPE b); | |
470 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
471 | void Print (ostream &os) const; |
472 | }; | |
473 | ||
474 | ||
475 | class AttributeCertificateInfoChoice: public AsnType | |
476 | { | |
477 | public: | |
478 | enum ChoiceIdEnum | |
479 | { | |
480 | baseCertificateIDCid = 0, | |
481 | subjectNameCid = 1 | |
482 | }; | |
483 | ||
484 | enum ChoiceIdEnum choiceId; | |
485 | union | |
486 | { | |
487 | IssuerSerial *baseCertificateID; | |
488 | GeneralNames *subjectName; | |
489 | }; | |
490 | ||
491 | ||
492 | AttributeCertificateInfoChoice(); | |
493 | AttributeCertificateInfoChoice (const AttributeCertificateInfoChoice &); | |
494 | virtual ~AttributeCertificateInfoChoice(); | |
495 | ||
496 | virtual AsnType *Clone() const; | |
497 | ||
498 | virtual AsnType *Copy() const; | |
499 | ||
500 | AttributeCertificateInfoChoice &operator = (const AttributeCertificateInfoChoice &); | |
501 | AsnLen BEncContent (BUF_TYPE b); | |
502 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
503 | AsnLen BEnc (BUF_TYPE b); | |
504 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
505 | void Print (ostream &os) const; |
506 | }; | |
507 | ||
508 | ||
509 | class CRLToSignSeqOfSeq: public AsnType | |
510 | { | |
511 | public: | |
512 | CertificateSerialNumber userCertificate; | |
513 | Time *revocationDate; | |
514 | Extensions *crlEntryExtensions; | |
515 | ||
516 | CRLToSignSeqOfSeq(); | |
517 | CRLToSignSeqOfSeq (const CRLToSignSeqOfSeq &); | |
518 | virtual ~CRLToSignSeqOfSeq(); | |
519 | virtual AsnType *Clone() const; | |
520 | ||
521 | virtual AsnType *Copy() const; | |
522 | ||
523 | CRLToSignSeqOfSeq &operator = (const CRLToSignSeqOfSeq &); | |
524 | AsnLen BEncContent (BUF_TYPE b); | |
525 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
526 | ||
527 | AsnLen BEnc (BUF_TYPE b); | |
528 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
529 | void Print (ostream &os) const; |
530 | }; | |
531 | ||
532 | ||
533 | class CRLToSignSeqOf: public AsnType | |
534 | { | |
535 | protected: | |
536 | unsigned long int count; | |
537 | struct AsnListElmt | |
538 | { | |
539 | AsnListElmt *next; | |
540 | AsnListElmt *prev; | |
541 | CRLToSignSeqOfSeq *elmt; | |
542 | } *first, *curr, *last; | |
543 | ||
544 | public: | |
545 | CRLToSignSeqOf() { count = 0; first = curr = last = NULL; } | |
546 | CRLToSignSeqOf (const CRLToSignSeqOf &); | |
547 | virtual ~CRLToSignSeqOf(); | |
548 | virtual AsnType *Clone() const; | |
549 | ||
550 | virtual AsnType *Copy() const; | |
551 | ||
552 | CRLToSignSeqOf &operator = (const CRLToSignSeqOf &); | |
553 | void SetCurrElmt (unsigned long int index); | |
554 | unsigned long int GetCurrElmtIndex(); | |
555 | void SetCurrToFirst() { curr = first; } | |
556 | void SetCurrToLast() { curr = last; } | |
557 | // reading member fcns | |
558 | int Count() const { return count; } | |
559 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
560 | CRLToSignSeqOfSeq *First() const { return count > 0 ? first->elmt : NULL; } | |
561 | CRLToSignSeqOfSeq *Last() const { return count > 0 ? last->elmt : NULL; } | |
562 | CRLToSignSeqOfSeq *Curr() const { return curr ? curr->elmt : NULL; } | |
563 | CRLToSignSeqOfSeq *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
564 | CRLToSignSeqOfSeq *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
565 | ||
566 | // routines that move the curr elmt | |
567 | CRLToSignSeqOfSeq *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
568 | CRLToSignSeqOfSeq *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
569 | ||
570 | // write & alloc fcns - returns new elmt | |
571 | CRLToSignSeqOfSeq *Append(); // add elmt to end of list | |
572 | CRLToSignSeqOfSeq *Prepend(); // add elmt to beginning of list | |
573 | CRLToSignSeqOfSeq *InsertBefore(); //insert elmt before current elmt | |
574 | CRLToSignSeqOfSeq *InsertAfter(); //insert elmt after current elmt | |
575 | ||
576 | // write & alloc & copy - returns list after copying elmt | |
577 | CRLToSignSeqOf &AppendCopy (CRLToSignSeqOfSeq &elmt); // add elmt to end of list | |
578 | CRLToSignSeqOf &PrependCopy (CRLToSignSeqOfSeq &elmt); // add elmt to beginning of list | |
579 | CRLToSignSeqOf &InsertBeforeAndCopy (CRLToSignSeqOfSeq &elmt); //insert elmt before current elmt | |
580 | CRLToSignSeqOf &InsertAfterAndCopy (CRLToSignSeqOfSeq &elmt); //insert elmt after current elmt | |
581 | ||
582 | // removing the current elmt from the list | |
583 | void RemoveCurrFromList(); | |
584 | ||
585 | // encode and decode routines | |
586 | AsnLen BEnc (BUF_TYPE b); | |
587 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
588 | AsnLen BEncContent (BUF_TYPE b); | |
589 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
590 | ||
591 | PDU_MEMBER_MACROS | |
592 | void Print (ostream &os) const; | |
593 | }; | |
594 | ||
595 | ||
596 | class CertificateToSign: public AsnType | |
597 | { | |
598 | public: | |
599 | Version *version; | |
600 | CertificateSerialNumber serialNumber; | |
601 | AlgorithmIdentifier *signature; | |
602 | Name *issuer; | |
603 | Validity *validity; | |
604 | Name *subject; | |
605 | SubjectPublicKeyInfo *subjectPublicKeyInfo; | |
606 | UniqueIdentifier *issuerUniqueIdentifier; | |
607 | UniqueIdentifier *subjectUniqueIdentifier; | |
608 | Extensions *extensions; | |
609 | ||
610 | CertificateToSign(); | |
611 | CertificateToSign (const CertificateToSign &); | |
612 | virtual ~CertificateToSign(); | |
613 | virtual AsnType *Clone() const; | |
614 | ||
615 | virtual AsnType *Copy() const; | |
616 | ||
617 | CertificateToSign &operator = (const CertificateToSign &); | |
618 | AsnLen BEncContent (BUF_TYPE b); | |
619 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
620 | ||
621 | AsnLen BEnc (BUF_TYPE b); | |
622 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
623 | void Print (ostream &os) const; |
624 | }; | |
625 | ||
626 | ||
627 | class CRLToSign: public AsnType | |
628 | { | |
629 | public: | |
630 | Version *version; | |
631 | AlgorithmIdentifier *signature; | |
632 | Name *issuer; | |
633 | Time *thisUpdate; | |
634 | Time *nextUpdate; | |
635 | CRLToSignSeqOf *revokedCertificates; | |
636 | Extensions *crlExtensions; | |
637 | ||
638 | CRLToSign(); | |
639 | CRLToSign (const CRLToSign &); | |
640 | virtual ~CRLToSign(); | |
641 | virtual AsnType *Clone() const; | |
642 | ||
643 | virtual AsnType *Copy() const; | |
644 | ||
645 | CRLToSign &operator = (const CRLToSign &); | |
646 | AsnLen BEncContent (BUF_TYPE b); | |
647 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
648 | ||
649 | AsnLen BEnc (BUF_TYPE b); | |
650 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
651 | void Print (ostream &os) const; |
652 | }; | |
653 | ||
654 | ||
655 | class AttributeCertificateInfo: public AsnType | |
656 | { | |
657 | public: | |
658 | Version *version; | |
659 | AttributeCertificateInfoChoice *subject; | |
660 | GeneralNames issuer; | |
661 | AlgorithmIdentifier *signature; | |
662 | CertificateSerialNumber serialNumber; | |
663 | AttCertValidityPeriod *attCertValidityPeriod; | |
664 | AttributeCertificateInfoSeqOf attributes; | |
665 | UniqueIdentifier *issuerUniqueID; | |
666 | Extensions *extensions; | |
667 | ||
668 | AttributeCertificateInfo(); | |
669 | AttributeCertificateInfo (const AttributeCertificateInfo &); | |
670 | virtual ~AttributeCertificateInfo(); | |
671 | virtual AsnType *Clone() const; | |
672 | ||
673 | virtual AsnType *Copy() const; | |
674 | ||
675 | AttributeCertificateInfo &operator = (const AttributeCertificateInfo &); | |
676 | AsnLen BEncContent (BUF_TYPE b); | |
677 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
678 | ||
679 | AsnLen BEnc (BUF_TYPE b); | |
680 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
681 | void Print (ostream &os) const; |
682 | }; | |
683 | ||
684 | ||
685 | class Certificate: public AsnType | |
686 | { | |
687 | public: | |
688 | CertificateToSign *certificateToSign; | |
689 | AlgorithmIdentifier *algorithmIdentifier; | |
690 | AsnBits signatureValue; | |
691 | ||
692 | Certificate(); | |
693 | Certificate (const Certificate &); | |
694 | virtual ~Certificate(); | |
695 | virtual AsnType *Clone() const; | |
696 | ||
697 | virtual AsnType *Copy() const; | |
698 | ||
699 | Certificate &operator = (const Certificate &); | |
700 | AsnLen BEncContent (BUF_TYPE b); | |
701 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
702 | ||
703 | AsnLen BEnc (BUF_TYPE b); | |
704 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
705 | void Print (ostream &os) const; |
706 | }; | |
707 | ||
708 | ||
709 | class CrossCertificates: public AsnType | |
710 | { | |
711 | protected: | |
712 | unsigned long int count; | |
713 | struct AsnListElmt | |
714 | { | |
715 | AsnListElmt *next; | |
716 | AsnListElmt *prev; | |
717 | Certificate *elmt; | |
718 | } *first, *curr, *last; | |
719 | ||
720 | public: | |
721 | CrossCertificates() { count = 0; first = curr = last = NULL; } | |
722 | CrossCertificates (const CrossCertificates &); | |
723 | virtual ~CrossCertificates(); | |
724 | virtual AsnType *Clone() const; | |
725 | ||
726 | virtual AsnType *Copy() const; | |
727 | ||
728 | CrossCertificates &operator = (const CrossCertificates &); | |
729 | void SetCurrElmt (unsigned long int index); | |
730 | unsigned long int GetCurrElmtIndex(); | |
731 | void SetCurrToFirst() { curr = first; } | |
732 | void SetCurrToLast() { curr = last; } | |
733 | // reading member fcns | |
734 | int Count() const { return count; } | |
735 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
736 | Certificate *First() const { return count > 0 ? first->elmt : NULL; } | |
737 | Certificate *Last() const { return count > 0 ? last->elmt : NULL; } | |
738 | Certificate *Curr() const { return curr ? curr->elmt : NULL; } | |
739 | Certificate *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
740 | Certificate *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
741 | ||
742 | // routines that move the curr elmt | |
743 | Certificate *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
744 | Certificate *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
745 | ||
746 | // write & alloc fcns - returns new elmt | |
747 | Certificate *Append(); // add elmt to end of list | |
748 | Certificate *Prepend(); // add elmt to beginning of list | |
749 | Certificate *InsertBefore(); //insert elmt before current elmt | |
750 | Certificate *InsertAfter(); //insert elmt after current elmt | |
751 | ||
752 | // write & alloc & copy - returns list after copying elmt | |
753 | CrossCertificates &AppendCopy (Certificate &elmt); // add elmt to end of list | |
754 | CrossCertificates &PrependCopy (Certificate &elmt); // add elmt to beginning of list | |
755 | CrossCertificates &InsertBeforeAndCopy (Certificate &elmt); //insert elmt before current elmt | |
756 | CrossCertificates &InsertAfterAndCopy (Certificate &elmt); //insert elmt after current elmt | |
757 | ||
758 | // removing the current elmt from the list | |
759 | void RemoveCurrFromList(); | |
760 | ||
761 | // encode and decode routines | |
762 | AsnLen BEnc (BUF_TYPE b); | |
763 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
764 | AsnLen BEncContent (BUF_TYPE b); | |
765 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
766 | ||
767 | PDU_MEMBER_MACROS | |
768 | void Print (ostream &os) const; | |
769 | }; | |
770 | ||
771 | ||
772 | class CertificatePair: public AsnType | |
773 | { | |
774 | public: | |
775 | Certificate *forward; | |
776 | Certificate *reverse; | |
777 | ||
778 | CertificatePair(); | |
779 | CertificatePair (const CertificatePair &); | |
780 | virtual ~CertificatePair(); | |
781 | virtual AsnType *Clone() const; | |
782 | ||
783 | virtual AsnType *Copy() const; | |
784 | ||
785 | CertificatePair &operator = (const CertificatePair &); | |
786 | AsnLen BEncContent (BUF_TYPE b); | |
787 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
788 | ||
789 | AsnLen BEnc (BUF_TYPE b); | |
790 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
791 | void Print (ostream &os) const; |
792 | }; | |
793 | ||
794 | ||
795 | class CertificateList: public AsnType | |
796 | { | |
797 | public: | |
798 | CRLToSign *crlToSign; | |
799 | AlgorithmIdentifier *algorithmIdentifier; | |
800 | AsnBits signatureValue; | |
801 | ||
802 | CertificateList(); | |
803 | CertificateList (const CertificateList &); | |
804 | virtual ~CertificateList(); | |
805 | virtual AsnType *Clone() const; | |
806 | ||
807 | virtual AsnType *Copy() const; | |
808 | ||
809 | CertificateList &operator = (const CertificateList &); | |
810 | AsnLen BEncContent (BUF_TYPE b); | |
811 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
812 | ||
813 | AsnLen BEnc (BUF_TYPE b); | |
814 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
815 | void Print (ostream &os) const; |
816 | }; | |
817 | ||
818 | ||
819 | class AttributeCertificate: public AsnType | |
820 | { | |
821 | public: | |
822 | AttributeCertificateInfo *attributeCertificateInfo; | |
823 | AlgorithmIdentifier *algorithmIdentifier; | |
824 | AsnBits signatureValue; | |
825 | ||
826 | AttributeCertificate(); | |
827 | AttributeCertificate (const AttributeCertificate &); | |
828 | virtual ~AttributeCertificate(); | |
829 | virtual AsnType *Clone() const; | |
830 | ||
831 | virtual AsnType *Copy() const; | |
832 | ||
833 | AttributeCertificate &operator = (const AttributeCertificate &); | |
834 | AsnLen BEncContent (BUF_TYPE b); | |
835 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
836 | ||
837 | AsnLen BEnc (BUF_TYPE b); | |
838 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
839 | void Print (ostream &os) const; |
840 | }; | |
841 | ||
842 | ||
843 | class CertificationPathSeqOf: public AsnType | |
844 | { | |
845 | protected: | |
846 | unsigned long int count; | |
847 | struct AsnListElmt | |
848 | { | |
849 | AsnListElmt *next; | |
850 | AsnListElmt *prev; | |
851 | CertificatePair *elmt; | |
852 | } *first, *curr, *last; | |
853 | ||
854 | public: | |
855 | CertificationPathSeqOf() { count = 0; first = curr = last = NULL; } | |
856 | CertificationPathSeqOf (const CertificationPathSeqOf &); | |
857 | virtual ~CertificationPathSeqOf(); | |
858 | virtual AsnType *Clone() const; | |
859 | ||
860 | virtual AsnType *Copy() const; | |
861 | ||
862 | CertificationPathSeqOf &operator = (const CertificationPathSeqOf &); | |
863 | void SetCurrElmt (unsigned long int index); | |
864 | unsigned long int GetCurrElmtIndex(); | |
865 | void SetCurrToFirst() { curr = first; } | |
866 | void SetCurrToLast() { curr = last; } | |
867 | // reading member fcns | |
868 | int Count() const { return count; } | |
869 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
870 | CertificatePair *First() const { return count > 0 ? first->elmt : NULL; } | |
871 | CertificatePair *Last() const { return count > 0 ? last->elmt : NULL; } | |
872 | CertificatePair *Curr() const { return curr ? curr->elmt : NULL; } | |
873 | CertificatePair *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
874 | CertificatePair *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
875 | ||
876 | // routines that move the curr elmt | |
877 | CertificatePair *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
878 | CertificatePair *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
879 | ||
880 | // write & alloc fcns - returns new elmt | |
881 | CertificatePair *Append(); // add elmt to end of list | |
882 | CertificatePair *Prepend(); // add elmt to beginning of list | |
883 | CertificatePair *InsertBefore(); //insert elmt before current elmt | |
884 | CertificatePair *InsertAfter(); //insert elmt after current elmt | |
885 | ||
886 | // write & alloc & copy - returns list after copying elmt | |
887 | CertificationPathSeqOf &AppendCopy (CertificatePair &elmt); // add elmt to end of list | |
888 | CertificationPathSeqOf &PrependCopy (CertificatePair &elmt); // add elmt to beginning of list | |
889 | CertificationPathSeqOf &InsertBeforeAndCopy (CertificatePair &elmt); //insert elmt before current elmt | |
890 | CertificationPathSeqOf &InsertAfterAndCopy (CertificatePair &elmt); //insert elmt after current elmt | |
891 | ||
892 | // removing the current elmt from the list | |
893 | void RemoveCurrFromList(); | |
894 | ||
895 | // encode and decode routines | |
896 | AsnLen BEnc (BUF_TYPE b); | |
897 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
898 | AsnLen BEncContent (BUF_TYPE b); | |
899 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
900 | ||
901 | PDU_MEMBER_MACROS | |
902 | void Print (ostream &os) const; | |
903 | }; | |
904 | ||
905 | ||
906 | class ForwardCertificationPath: public AsnType | |
907 | { | |
908 | protected: | |
909 | unsigned long int count; | |
910 | struct AsnListElmt | |
911 | { | |
912 | AsnListElmt *next; | |
913 | AsnListElmt *prev; | |
914 | CrossCertificates *elmt; | |
915 | } *first, *curr, *last; | |
916 | ||
917 | public: | |
918 | ForwardCertificationPath() { count = 0; first = curr = last = NULL; } | |
919 | ForwardCertificationPath (const ForwardCertificationPath &); | |
920 | virtual ~ForwardCertificationPath(); | |
921 | virtual AsnType *Clone() const; | |
922 | ||
923 | virtual AsnType *Copy() const; | |
924 | ||
925 | ForwardCertificationPath &operator = (const ForwardCertificationPath &); | |
926 | void SetCurrElmt (unsigned long int index); | |
927 | unsigned long int GetCurrElmtIndex(); | |
928 | void SetCurrToFirst() { curr = first; } | |
929 | void SetCurrToLast() { curr = last; } | |
930 | // reading member fcns | |
931 | int Count() const { return count; } | |
932 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
933 | CrossCertificates *First() const { return count > 0 ? first->elmt : NULL; } | |
934 | CrossCertificates *Last() const { return count > 0 ? last->elmt : NULL; } | |
935 | CrossCertificates *Curr() const { return curr ? curr->elmt : NULL; } | |
936 | CrossCertificates *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
937 | CrossCertificates *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
938 | ||
939 | // routines that move the curr elmt | |
940 | CrossCertificates *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
941 | CrossCertificates *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
942 | ||
943 | // write & alloc fcns - returns new elmt | |
944 | CrossCertificates *Append(); // add elmt to end of list | |
945 | CrossCertificates *Prepend(); // add elmt to beginning of list | |
946 | CrossCertificates *InsertBefore(); //insert elmt before current elmt | |
947 | CrossCertificates *InsertAfter(); //insert elmt after current elmt | |
948 | ||
949 | // write & alloc & copy - returns list after copying elmt | |
950 | ForwardCertificationPath &AppendCopy (CrossCertificates &elmt); // add elmt to end of list | |
951 | ForwardCertificationPath &PrependCopy (CrossCertificates &elmt); // add elmt to beginning of list | |
952 | ForwardCertificationPath &InsertBeforeAndCopy (CrossCertificates &elmt); //insert elmt before current elmt | |
953 | ForwardCertificationPath &InsertAfterAndCopy (CrossCertificates &elmt); //insert elmt after current elmt | |
954 | ||
955 | // removing the current elmt from the list | |
956 | void RemoveCurrFromList(); | |
957 | ||
958 | // encode and decode routines | |
959 | AsnLen BEnc (BUF_TYPE b); | |
960 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
961 | AsnLen BEncContent (BUF_TYPE b); | |
962 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
963 | ||
964 | PDU_MEMBER_MACROS | |
965 | void Print (ostream &os) const; | |
966 | }; | |
967 | ||
968 | ||
969 | class ACPathData: public AsnType | |
970 | { | |
971 | public: | |
972 | Certificate *certificate; | |
973 | AttributeCertificate *attributeCertificate; | |
974 | ||
975 | ACPathData(); | |
976 | ACPathData (const ACPathData &); | |
977 | virtual ~ACPathData(); | |
978 | virtual AsnType *Clone() const; | |
979 | ||
980 | virtual AsnType *Copy() const; | |
981 | ||
982 | ACPathData &operator = (const ACPathData &); | |
983 | AsnLen BEncContent (BUF_TYPE b); | |
984 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
985 | ||
986 | AsnLen BEnc (BUF_TYPE b); | |
987 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
988 | void Print (ostream &os) const; |
989 | }; | |
990 | ||
991 | ||
992 | class AttributeCertificationPathSeqOf: public AsnType | |
993 | { | |
994 | protected: | |
995 | unsigned long int count; | |
996 | struct AsnListElmt | |
997 | { | |
998 | AsnListElmt *next; | |
999 | AsnListElmt *prev; | |
1000 | ACPathData *elmt; | |
1001 | } *first, *curr, *last; | |
1002 | ||
1003 | public: | |
1004 | AttributeCertificationPathSeqOf() { count = 0; first = curr = last = NULL; } | |
1005 | AttributeCertificationPathSeqOf (const AttributeCertificationPathSeqOf &); | |
1006 | virtual ~AttributeCertificationPathSeqOf(); | |
1007 | virtual AsnType *Clone() const; | |
1008 | ||
1009 | virtual AsnType *Copy() const; | |
1010 | ||
1011 | AttributeCertificationPathSeqOf &operator = (const AttributeCertificationPathSeqOf &); | |
1012 | void SetCurrElmt (unsigned long int index); | |
1013 | unsigned long int GetCurrElmtIndex(); | |
1014 | void SetCurrToFirst() { curr = first; } | |
1015 | void SetCurrToLast() { curr = last; } | |
1016 | // reading member fcns | |
1017 | int Count() const { return count; } | |
1018 | // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!) | |
1019 | ACPathData *First() const { return count > 0 ? first->elmt : NULL; } | |
1020 | ACPathData *Last() const { return count > 0 ? last->elmt : NULL; } | |
1021 | ACPathData *Curr() const { return curr ? curr->elmt : NULL; } | |
1022 | ACPathData *Next() const { return curr && curr->next ? curr->next->elmt : NULL; } | |
1023 | ACPathData *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; } | |
1024 | ||
1025 | // routines that move the curr elmt | |
1026 | ACPathData *GoNext() { if (curr) curr = curr->next; return Curr(); } | |
1027 | ACPathData *GoPrev() { if (curr) curr = curr->prev; return Curr(); } | |
1028 | ||
1029 | // write & alloc fcns - returns new elmt | |
1030 | ACPathData *Append(); // add elmt to end of list | |
1031 | ACPathData *Prepend(); // add elmt to beginning of list | |
1032 | ACPathData *InsertBefore(); //insert elmt before current elmt | |
1033 | ACPathData *InsertAfter(); //insert elmt after current elmt | |
1034 | ||
1035 | // write & alloc & copy - returns list after copying elmt | |
1036 | AttributeCertificationPathSeqOf &AppendCopy (ACPathData &elmt); // add elmt to end of list | |
1037 | AttributeCertificationPathSeqOf &PrependCopy (ACPathData &elmt); // add elmt to beginning of list | |
1038 | AttributeCertificationPathSeqOf &InsertBeforeAndCopy (ACPathData &elmt); //insert elmt before current elmt | |
1039 | AttributeCertificationPathSeqOf &InsertAfterAndCopy (ACPathData &elmt); //insert elmt after current elmt | |
1040 | ||
1041 | // removing the current elmt from the list | |
1042 | void RemoveCurrFromList(); | |
1043 | ||
1044 | // encode and decode routines | |
1045 | AsnLen BEnc (BUF_TYPE b); | |
1046 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
1047 | AsnLen BEncContent (BUF_TYPE b); | |
1048 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
1049 | ||
1050 | PDU_MEMBER_MACROS | |
1051 | void Print (ostream &os) const; | |
1052 | }; | |
1053 | ||
1054 | ||
1055 | class Certificates: public AsnType | |
1056 | { | |
1057 | public: | |
1058 | Certificate *userCertificate; | |
1059 | ForwardCertificationPath *certificationPath; | |
1060 | ||
1061 | Certificates(); | |
1062 | Certificates (const Certificates &); | |
1063 | virtual ~Certificates(); | |
1064 | virtual AsnType *Clone() const; | |
1065 | ||
1066 | virtual AsnType *Copy() const; | |
1067 | ||
1068 | Certificates &operator = (const Certificates &); | |
1069 | AsnLen BEncContent (BUF_TYPE b); | |
1070 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
1071 | ||
1072 | AsnLen BEnc (BUF_TYPE b); | |
1073 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
1074 | void Print (ostream &os) const; |
1075 | }; | |
1076 | ||
1077 | ||
1078 | class CertificationPath: public AsnType | |
1079 | { | |
1080 | public: | |
1081 | Certificate *userCertificate; | |
1082 | CertificationPathSeqOf *theCACertificates; | |
1083 | ||
1084 | CertificationPath(); | |
1085 | CertificationPath (const CertificationPath &); | |
1086 | virtual ~CertificationPath(); | |
1087 | virtual AsnType *Clone() const; | |
1088 | ||
1089 | virtual AsnType *Copy() const; | |
1090 | ||
1091 | CertificationPath &operator = (const CertificationPath &); | |
1092 | AsnLen BEncContent (BUF_TYPE b); | |
1093 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
1094 | ||
1095 | AsnLen BEnc (BUF_TYPE b); | |
1096 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
1097 | void Print (ostream &os) const; |
1098 | }; | |
1099 | ||
1100 | ||
1101 | class AttributeCertificationPath: public AsnType | |
1102 | { | |
1103 | public: | |
1104 | AttributeCertificate *attributeCertificate; | |
1105 | AttributeCertificationPathSeqOf *acPath; | |
1106 | ||
1107 | AttributeCertificationPath(); | |
1108 | AttributeCertificationPath (const AttributeCertificationPath &); | |
1109 | virtual ~AttributeCertificationPath(); | |
1110 | virtual AsnType *Clone() const; | |
1111 | ||
1112 | virtual AsnType *Copy() const; | |
1113 | ||
1114 | AttributeCertificationPath &operator = (const AttributeCertificationPath &); | |
1115 | AsnLen BEncContent (BUF_TYPE b); | |
1116 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
1117 | ||
1118 | AsnLen BEnc (BUF_TYPE b); | |
1119 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
1120 | void Print (ostream &os) const; |
1121 | }; | |
1122 | ||
1123 | ||
1124 | class AttributeCertificateAssertion: public AsnType | |
1125 | { | |
1126 | public: | |
1127 | AttributeCertificateAssertionChoice *subject; | |
1128 | Name *issuer; | |
1129 | GeneralizedTime *attCertValidity; | |
1130 | AttributeCertificateAssertionSetOf *attType; | |
1131 | ||
1132 | AttributeCertificateAssertion(); | |
1133 | AttributeCertificateAssertion (const AttributeCertificateAssertion &); | |
1134 | virtual ~AttributeCertificateAssertion(); | |
1135 | virtual AsnType *Clone() const; | |
1136 | ||
1137 | virtual AsnType *Copy() const; | |
1138 | ||
1139 | AttributeCertificateAssertion &operator = (const AttributeCertificateAssertion &); | |
1140 | AsnLen BEncContent (BUF_TYPE b); | |
1141 | void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env); | |
1142 | ||
1143 | AsnLen BEnc (BUF_TYPE b); | |
1144 | void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env); | |
bac41a7b A |
1145 | void Print (ostream &os) const; |
1146 | }; | |
1147 | ||
1148 | ||
1149 | /* Certificate */ | |
1150 | typedef Certificate UserCertificate; | |
1151 | ||
1152 | /* Certificate */ | |
1153 | typedef Certificate CACertificate; | |
1154 | ||
1155 | /* CertificatePair */ | |
1156 | typedef CertificatePair CrossCertificatePair; | |
1157 | ||
1158 | /* CertificateList */ | |
1159 | typedef CertificateList AuthorityRevocationList; | |
1160 | ||
1161 | /* CertificateList */ | |
1162 | typedef CertificateList CertificateRevocationList; | |
1163 | ||
1164 | /* CertificateList */ | |
1165 | typedef CertificateList AttributeCertificateRevocationList; | |
1166 | ||
1167 | //------------------------------------------------------------------------------ | |
1168 | // externs for value defs | |
1169 | ||
1170 | #define id_at_userPassword_arc 2, 5, 4, 35 | |
1171 | #define id_at_userPassword AsnOid(id_at_userPassword_arc) | |
1172 | #define id_at_userCertificate_arc 2, 5, 4, 36 | |
1173 | #define id_at_userCertificate AsnOid(id_at_userCertificate_arc) | |
1174 | #define id_at_cAcertificate_arc 2, 5, 4, 37 | |
1175 | #define id_at_cAcertificate AsnOid(id_at_cAcertificate_arc) | |
1176 | #define id_at_authorityRevocationList_arc 2, 5, 4, 38 | |
1177 | #define id_at_authorityRevocationList AsnOid(id_at_authorityRevocationList_arc) | |
1178 | #define id_at_certificateRevocationList_arc 2, 5, 4, 39 | |
1179 | #define id_at_certificateRevocationList AsnOid(id_at_certificateRevocationList_arc) | |
1180 | #define id_at_crossCertificatePair_arc 2, 5, 4, 40 | |
1181 | #define id_at_crossCertificatePair AsnOid(id_at_crossCertificatePair_arc) | |
1182 | #define id_at_attributeCertificate_arc 2, 5, 4, 58 | |
1183 | #define id_at_attributeCertificate AsnOid(id_at_attributeCertificate_arc) | |
1184 | //------------------------------------------------------------------------------ | |
1185 | ||
1186 | #endif /* conditional include of sm_x509af.h */ |