]> git.saurik.com Git - apple/security.git/blob - SecurityASN1/inc/sm_ess.h
Security-30.1.tar.gz
[apple/security.git] / SecurityASN1 / inc / sm_ess.h
1 // NOTE: this is a machine generated file--editing not recommended
2 //
3 // sm_ess.h - class definitions for ASN.1 module ExtendedSecurityServices
4 //
5 // This file was generated by snacc on Wed Jun 27 16:40:55 2001
6 // UBC snacc by Mike Sample
7 // A couple of enhancements made by IBM European Networking Center
8
9 #ifndef _sm_ess_h_
10 #define _sm_ess_h_
11
12
13 //------------------------------------------------------------------------------
14 // class declarations:
15
16 class AllOrFirstTier;
17 class SecurityClassification;
18 class SigningCertificateSeqOf1;
19 class MLReceiptPolicySeqOf1;
20 class MLReceiptPolicySeqOf;
21 class ReceiptsFromSeqOf;
22 class ReceiptRequestSeqOf;
23 class ESSPrivacyMark;
24 class SecurityCategory;
25 class EntityIdentifier;
26 class ReceiptsFrom;
27 class SecurityCategories;
28 class MLReceiptPolicy;
29 class ESSCertID;
30 class SigningCertificateSeqOf;
31 class ESSSecurityLabel;
32 class MLData;
33 class ReceiptRequest;
34 class Receipt;
35 class ContentHints;
36 class ContentReference;
37 class EquivalentLabels;
38 class MLExpansionHistory;
39 class SigningCertificate;
40
41 //------------------------------------------------------------------------------
42 // class definitions:
43
44 typedef enum ExtendedSecurityServicesAnyId
45 {
46
47 } ExtendedSecurityServicesAnyId;
48
49
50 /* OCTET STRING */
51 typedef AsnOcts ContentIdentifier;
52
53 /* INTEGER { allReceipts (0), firstTierRecipients (1) } */
54 class AllOrFirstTier: public AsnInt
55 {
56 public:
57 AllOrFirstTier(): AsnInt() {}
58 AllOrFirstTier (int i): AsnInt (i) {}
59 enum
60 {
61 allReceipts = 0,
62 firstTierRecipients = 1
63 };
64 };
65
66
67 /* OCTET STRING */
68 typedef AsnOcts MsgSigDigest;
69
70 /* OBJECT IDENTIFIER */
71 typedef AsnOid SecurityPolicyIdentifier;
72
73 /* INTEGER { unmarked (0), unclassified (1), restricted (2), confidential (3), secret (4), top_secret (5) } (0..ub-integer-options) */
74 class SecurityClassification: public AsnInt
75 {
76 public:
77 SecurityClassification(): AsnInt() {}
78 SecurityClassification (int i): AsnInt (i) {}
79 enum
80 {
81 unmarked = 0,
82 unclassified = 1,
83 restricted = 2,
84 confidential = 3,
85 secret = 4,
86 top_secret = 5
87 };
88 };
89
90
91 /* OCTET STRING */
92 typedef AsnOcts CertHash;
93
94 /* OBJECT IDENTIFIER (id-qt-cps) | (id-qt-unotice) */
95 typedef AsnOid PolicyQualifierId;
96
97 class SigningCertificateSeqOf1: public AsnType
98 {
99 protected:
100 unsigned long int count;
101 struct AsnListElmt
102 {
103 AsnListElmt *next;
104 AsnListElmt *prev;
105 PolicyInformation *elmt;
106 } *first, *curr, *last;
107
108 public:
109 SigningCertificateSeqOf1() { count = 0; first = curr = last = NULL; }
110 SigningCertificateSeqOf1 (const SigningCertificateSeqOf1 &);
111 virtual ~SigningCertificateSeqOf1();
112 virtual AsnType *Clone() const;
113
114 virtual AsnType *Copy() const;
115
116 SigningCertificateSeqOf1 &operator = (const SigningCertificateSeqOf1 &);
117 void SetCurrElmt (unsigned long int index);
118 unsigned long int GetCurrElmtIndex();
119 void SetCurrToFirst() { curr = first; }
120 void SetCurrToLast() { curr = last; }
121 // reading member fcns
122 int Count() const { return count; }
123 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
124 PolicyInformation *First() const { return count > 0 ? first->elmt : NULL; }
125 PolicyInformation *Last() const { return count > 0 ? last->elmt : NULL; }
126 PolicyInformation *Curr() const { return curr ? curr->elmt : NULL; }
127 PolicyInformation *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
128 PolicyInformation *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
129
130 // routines that move the curr elmt
131 PolicyInformation *GoNext() { if (curr) curr = curr->next; return Curr(); }
132 PolicyInformation *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
133
134 // write & alloc fcns - returns new elmt
135 PolicyInformation *Append(); // add elmt to end of list
136 PolicyInformation *Prepend(); // add elmt to beginning of list
137 PolicyInformation *InsertBefore(); //insert elmt before current elmt
138 PolicyInformation *InsertAfter(); //insert elmt after current elmt
139
140 // write & alloc & copy - returns list after copying elmt
141 SigningCertificateSeqOf1 &AppendCopy (PolicyInformation &elmt); // add elmt to end of list
142 SigningCertificateSeqOf1 &PrependCopy (PolicyInformation &elmt); // add elmt to beginning of list
143 SigningCertificateSeqOf1 &InsertBeforeAndCopy (PolicyInformation &elmt); //insert elmt before current elmt
144 SigningCertificateSeqOf1 &InsertAfterAndCopy (PolicyInformation &elmt); //insert elmt after current elmt
145
146 // removing the current elmt from the list
147 void RemoveCurrFromList();
148
149 // encode and decode routines
150 AsnLen BEnc (BUF_TYPE b);
151 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
152 AsnLen BEncContent (BUF_TYPE b);
153 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
154
155 PDU_MEMBER_MACROS
156 void Print (ostream &os) const;
157 };
158
159
160 class MLReceiptPolicySeqOf1: public AsnType
161 {
162 protected:
163 unsigned long int count;
164 struct AsnListElmt
165 {
166 AsnListElmt *next;
167 AsnListElmt *prev;
168 GeneralNames *elmt;
169 } *first, *curr, *last;
170
171 public:
172 MLReceiptPolicySeqOf1() { count = 0; first = curr = last = NULL; }
173 MLReceiptPolicySeqOf1 (const MLReceiptPolicySeqOf1 &);
174 virtual ~MLReceiptPolicySeqOf1();
175 virtual AsnType *Clone() const;
176
177 virtual AsnType *Copy() const;
178
179 MLReceiptPolicySeqOf1 &operator = (const MLReceiptPolicySeqOf1 &);
180 void SetCurrElmt (unsigned long int index);
181 unsigned long int GetCurrElmtIndex();
182 void SetCurrToFirst() { curr = first; }
183 void SetCurrToLast() { curr = last; }
184 // reading member fcns
185 int Count() const { return count; }
186 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
187 GeneralNames *First() const { return count > 0 ? first->elmt : NULL; }
188 GeneralNames *Last() const { return count > 0 ? last->elmt : NULL; }
189 GeneralNames *Curr() const { return curr ? curr->elmt : NULL; }
190 GeneralNames *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
191 GeneralNames *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
192
193 // routines that move the curr elmt
194 GeneralNames *GoNext() { if (curr) curr = curr->next; return Curr(); }
195 GeneralNames *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
196
197 // write & alloc fcns - returns new elmt
198 GeneralNames *Append(); // add elmt to end of list
199 GeneralNames *Prepend(); // add elmt to beginning of list
200 GeneralNames *InsertBefore(); //insert elmt before current elmt
201 GeneralNames *InsertAfter(); //insert elmt after current elmt
202
203 // write & alloc & copy - returns list after copying elmt
204 MLReceiptPolicySeqOf1 &AppendCopy (GeneralNames &elmt); // add elmt to end of list
205 MLReceiptPolicySeqOf1 &PrependCopy (GeneralNames &elmt); // add elmt to beginning of list
206 MLReceiptPolicySeqOf1 &InsertBeforeAndCopy (GeneralNames &elmt); //insert elmt before current elmt
207 MLReceiptPolicySeqOf1 &InsertAfterAndCopy (GeneralNames &elmt); //insert elmt after current elmt
208
209 // removing the current elmt from the list
210 void RemoveCurrFromList();
211
212 // encode and decode routines
213 AsnLen BEnc (BUF_TYPE b);
214 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
215 AsnLen BEncContent (BUF_TYPE b);
216 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
217
218 PDU_MEMBER_MACROS
219 void Print (ostream &os) const;
220 };
221
222
223 class MLReceiptPolicySeqOf: public AsnType
224 {
225 protected:
226 unsigned long int count;
227 struct AsnListElmt
228 {
229 AsnListElmt *next;
230 AsnListElmt *prev;
231 GeneralNames *elmt;
232 } *first, *curr, *last;
233
234 public:
235 MLReceiptPolicySeqOf() { count = 0; first = curr = last = NULL; }
236 MLReceiptPolicySeqOf (const MLReceiptPolicySeqOf &);
237 virtual ~MLReceiptPolicySeqOf();
238 virtual AsnType *Clone() const;
239
240 virtual AsnType *Copy() const;
241
242 MLReceiptPolicySeqOf &operator = (const MLReceiptPolicySeqOf &);
243 void SetCurrElmt (unsigned long int index);
244 unsigned long int GetCurrElmtIndex();
245 void SetCurrToFirst() { curr = first; }
246 void SetCurrToLast() { curr = last; }
247 // reading member fcns
248 int Count() const { return count; }
249 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
250 GeneralNames *First() const { return count > 0 ? first->elmt : NULL; }
251 GeneralNames *Last() const { return count > 0 ? last->elmt : NULL; }
252 GeneralNames *Curr() const { return curr ? curr->elmt : NULL; }
253 GeneralNames *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
254 GeneralNames *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
255
256 // routines that move the curr elmt
257 GeneralNames *GoNext() { if (curr) curr = curr->next; return Curr(); }
258 GeneralNames *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
259
260 // write & alloc fcns - returns new elmt
261 GeneralNames *Append(); // add elmt to end of list
262 GeneralNames *Prepend(); // add elmt to beginning of list
263 GeneralNames *InsertBefore(); //insert elmt before current elmt
264 GeneralNames *InsertAfter(); //insert elmt after current elmt
265
266 // write & alloc & copy - returns list after copying elmt
267 MLReceiptPolicySeqOf &AppendCopy (GeneralNames &elmt); // add elmt to end of list
268 MLReceiptPolicySeqOf &PrependCopy (GeneralNames &elmt); // add elmt to beginning of list
269 MLReceiptPolicySeqOf &InsertBeforeAndCopy (GeneralNames &elmt); //insert elmt before current elmt
270 MLReceiptPolicySeqOf &InsertAfterAndCopy (GeneralNames &elmt); //insert elmt after current elmt
271
272 // removing the current elmt from the list
273 void RemoveCurrFromList();
274
275 // encode and decode routines
276 AsnLen BEnc (BUF_TYPE b);
277 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
278 AsnLen BEncContent (BUF_TYPE b);
279 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
280
281 PDU_MEMBER_MACROS
282 void Print (ostream &os) const;
283 };
284
285
286 class ReceiptsFromSeqOf: public AsnType
287 {
288 protected:
289 unsigned long int count;
290 struct AsnListElmt
291 {
292 AsnListElmt *next;
293 AsnListElmt *prev;
294 GeneralNames *elmt;
295 } *first, *curr, *last;
296
297 public:
298 ReceiptsFromSeqOf() { count = 0; first = curr = last = NULL; }
299 ReceiptsFromSeqOf (const ReceiptsFromSeqOf &);
300 virtual ~ReceiptsFromSeqOf();
301 virtual AsnType *Clone() const;
302
303 virtual AsnType *Copy() const;
304
305 ReceiptsFromSeqOf &operator = (const ReceiptsFromSeqOf &);
306 void SetCurrElmt (unsigned long int index);
307 unsigned long int GetCurrElmtIndex();
308 void SetCurrToFirst() { curr = first; }
309 void SetCurrToLast() { curr = last; }
310 // reading member fcns
311 int Count() const { return count; }
312 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
313 GeneralNames *First() const { return count > 0 ? first->elmt : NULL; }
314 GeneralNames *Last() const { return count > 0 ? last->elmt : NULL; }
315 GeneralNames *Curr() const { return curr ? curr->elmt : NULL; }
316 GeneralNames *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
317 GeneralNames *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
318
319 // routines that move the curr elmt
320 GeneralNames *GoNext() { if (curr) curr = curr->next; return Curr(); }
321 GeneralNames *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
322
323 // write & alloc fcns - returns new elmt
324 GeneralNames *Append(); // add elmt to end of list
325 GeneralNames *Prepend(); // add elmt to beginning of list
326 GeneralNames *InsertBefore(); //insert elmt before current elmt
327 GeneralNames *InsertAfter(); //insert elmt after current elmt
328
329 // write & alloc & copy - returns list after copying elmt
330 ReceiptsFromSeqOf &AppendCopy (GeneralNames &elmt); // add elmt to end of list
331 ReceiptsFromSeqOf &PrependCopy (GeneralNames &elmt); // add elmt to beginning of list
332 ReceiptsFromSeqOf &InsertBeforeAndCopy (GeneralNames &elmt); //insert elmt before current elmt
333 ReceiptsFromSeqOf &InsertAfterAndCopy (GeneralNames &elmt); //insert elmt after current elmt
334
335 // removing the current elmt from the list
336 void RemoveCurrFromList();
337
338 // encode and decode routines
339 AsnLen BEnc (BUF_TYPE b);
340 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
341 AsnLen BEncContent (BUF_TYPE b);
342 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
343
344 PDU_MEMBER_MACROS
345 void Print (ostream &os) const;
346 };
347
348
349 class ReceiptRequestSeqOf: public AsnType
350 {
351 protected:
352 unsigned long int count;
353 struct AsnListElmt
354 {
355 AsnListElmt *next;
356 AsnListElmt *prev;
357 GeneralNames *elmt;
358 } *first, *curr, *last;
359
360 public:
361 ReceiptRequestSeqOf() { count = 0; first = curr = last = NULL; }
362 ReceiptRequestSeqOf (const ReceiptRequestSeqOf &);
363 virtual ~ReceiptRequestSeqOf();
364 virtual AsnType *Clone() const;
365
366 virtual AsnType *Copy() const;
367
368 ReceiptRequestSeqOf &operator = (const ReceiptRequestSeqOf &);
369 void SetCurrElmt (unsigned long int index);
370 unsigned long int GetCurrElmtIndex();
371 void SetCurrToFirst() { curr = first; }
372 void SetCurrToLast() { curr = last; }
373 // reading member fcns
374 int Count() const { return count; }
375 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
376 GeneralNames *First() const { return count > 0 ? first->elmt : NULL; }
377 GeneralNames *Last() const { return count > 0 ? last->elmt : NULL; }
378 GeneralNames *Curr() const { return curr ? curr->elmt : NULL; }
379 GeneralNames *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
380 GeneralNames *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
381
382 // routines that move the curr elmt
383 GeneralNames *GoNext() { if (curr) curr = curr->next; return Curr(); }
384 GeneralNames *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
385
386 // write & alloc fcns - returns new elmt
387 GeneralNames *Append(); // add elmt to end of list
388 GeneralNames *Prepend(); // add elmt to beginning of list
389 GeneralNames *InsertBefore(); //insert elmt before current elmt
390 GeneralNames *InsertAfter(); //insert elmt after current elmt
391
392 // write & alloc & copy - returns list after copying elmt
393 ReceiptRequestSeqOf &AppendCopy (GeneralNames &elmt); // add elmt to end of list
394 ReceiptRequestSeqOf &PrependCopy (GeneralNames &elmt); // add elmt to beginning of list
395 ReceiptRequestSeqOf &InsertBeforeAndCopy (GeneralNames &elmt); //insert elmt before current elmt
396 ReceiptRequestSeqOf &InsertAfterAndCopy (GeneralNames &elmt); //insert elmt after current elmt
397
398 // removing the current elmt from the list
399 void RemoveCurrFromList();
400
401 // encode and decode routines
402 AsnLen BEnc (BUF_TYPE b);
403 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
404 AsnLen BEncContent (BUF_TYPE b);
405 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
406
407 PDU_MEMBER_MACROS
408 void Print (ostream &os) const;
409 };
410
411
412 class ESSPrivacyMark: public AsnType
413 {
414 public:
415 enum ChoiceIdEnum
416 {
417 pStringCid = 0,
418 utf8StringCid = 1
419 };
420
421 enum ChoiceIdEnum choiceId;
422 union
423 {
424 PrintableString *pString;
425 UTF8String *utf8String;
426 };
427
428
429 ESSPrivacyMark();
430 ESSPrivacyMark (const ESSPrivacyMark &);
431 virtual ~ESSPrivacyMark();
432
433 virtual AsnType *Clone() const;
434
435 virtual AsnType *Copy() const;
436
437 ESSPrivacyMark &operator = (const ESSPrivacyMark &);
438 AsnLen BEncContent (BUF_TYPE b);
439 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
440 AsnLen BEnc (BUF_TYPE b);
441 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
442 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
443 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
444
445 void Print (ostream &os) const;
446 };
447
448
449 class SecurityCategory: public AsnType
450 {
451 public:
452 AsnOid type;
453 AsnAny value;
454
455 SecurityCategory();
456 SecurityCategory (const SecurityCategory &);
457 virtual ~SecurityCategory();
458 virtual AsnType *Clone() const;
459
460 virtual AsnType *Copy() const;
461
462 SecurityCategory &operator = (const SecurityCategory &);
463 AsnLen BEncContent (BUF_TYPE b);
464 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
465
466 AsnLen BEnc (BUF_TYPE b);
467 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
468 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
469 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
470
471 void Print (ostream &os) const;
472 };
473
474
475 class EntityIdentifier: public AsnType
476 {
477 public:
478 enum ChoiceIdEnum
479 {
480 issuerAndSerialNumberCid = 0,
481 subjectKeyIdentifierCid = 1
482 };
483
484 enum ChoiceIdEnum choiceId;
485 union
486 {
487 IssuerAndSerialNumber *issuerAndSerialNumber;
488 KeyIdentifier *subjectKeyIdentifier;
489 };
490
491
492 EntityIdentifier();
493 EntityIdentifier (const EntityIdentifier &);
494 virtual ~EntityIdentifier();
495
496 virtual AsnType *Clone() const;
497
498 virtual AsnType *Copy() const;
499
500 EntityIdentifier &operator = (const EntityIdentifier &);
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);
505 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
506 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
507
508 void Print (ostream &os) const;
509 };
510
511
512 class ReceiptsFrom: public AsnType
513 {
514 public:
515 enum ChoiceIdEnum
516 {
517 allOrFirstTierCid = 0,
518 receiptListCid = 1
519 };
520
521 enum ChoiceIdEnum choiceId;
522 union
523 {
524 AllOrFirstTier *allOrFirstTier;
525 ReceiptsFromSeqOf *receiptList;
526 };
527
528
529 ReceiptsFrom();
530 ReceiptsFrom (const ReceiptsFrom &);
531 virtual ~ReceiptsFrom();
532
533 virtual AsnType *Clone() const;
534
535 virtual AsnType *Copy() const;
536
537 ReceiptsFrom &operator = (const ReceiptsFrom &);
538 AsnLen BEncContent (BUF_TYPE b);
539 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
540 AsnLen BEnc (BUF_TYPE b);
541 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
542 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
543 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
544
545 void Print (ostream &os) const;
546 };
547
548
549 class SecurityCategories: public AsnType
550 {
551 protected:
552 unsigned long int count;
553 struct AsnListElmt
554 {
555 AsnListElmt *next;
556 AsnListElmt *prev;
557 SecurityCategory *elmt;
558 } *first, *curr, *last;
559
560 public:
561 SecurityCategories() { count = 0; first = curr = last = NULL; }
562 SecurityCategories (const SecurityCategories &);
563 virtual ~SecurityCategories();
564 virtual AsnType *Clone() const;
565
566 virtual AsnType *Copy() const;
567
568 SecurityCategories &operator = (const SecurityCategories &);
569 void SetCurrElmt (unsigned long int index);
570 unsigned long int GetCurrElmtIndex();
571 void SetCurrToFirst() { curr = first; }
572 void SetCurrToLast() { curr = last; }
573 // reading member fcns
574 int Count() const { return count; }
575 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
576 SecurityCategory *First() const { return count > 0 ? first->elmt : NULL; }
577 SecurityCategory *Last() const { return count > 0 ? last->elmt : NULL; }
578 SecurityCategory *Curr() const { return curr ? curr->elmt : NULL; }
579 SecurityCategory *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
580 SecurityCategory *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
581
582 // routines that move the curr elmt
583 SecurityCategory *GoNext() { if (curr) curr = curr->next; return Curr(); }
584 SecurityCategory *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
585
586 // write & alloc fcns - returns new elmt
587 SecurityCategory *Append(); // add elmt to end of list
588 SecurityCategory *Prepend(); // add elmt to beginning of list
589 SecurityCategory *InsertBefore(); //insert elmt before current elmt
590 SecurityCategory *InsertAfter(); //insert elmt after current elmt
591
592 // write & alloc & copy - returns list after copying elmt
593 SecurityCategories &AppendCopy (SecurityCategory &elmt); // add elmt to end of list
594 SecurityCategories &PrependCopy (SecurityCategory &elmt); // add elmt to beginning of list
595 SecurityCategories &InsertBeforeAndCopy (SecurityCategory &elmt); //insert elmt before current elmt
596 SecurityCategories &InsertAfterAndCopy (SecurityCategory &elmt); //insert elmt after current elmt
597
598 // removing the current elmt from the list
599 void RemoveCurrFromList();
600
601 // encode and decode routines
602 AsnLen BEnc (BUF_TYPE b);
603 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
604 AsnLen BEncContent (BUF_TYPE b);
605 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
606
607 PDU_MEMBER_MACROS
608 void Print (ostream &os) const;
609 };
610
611
612 class MLReceiptPolicy: public AsnType
613 {
614 public:
615 enum ChoiceIdEnum
616 {
617 noneCid = 0,
618 insteadOfCid = 1,
619 inAdditionToCid = 2
620 };
621
622 enum ChoiceIdEnum choiceId;
623 union
624 {
625 AsnNull *none;
626 MLReceiptPolicySeqOf *insteadOf;
627 MLReceiptPolicySeqOf1 *inAdditionTo;
628 };
629
630
631 MLReceiptPolicy();
632 MLReceiptPolicy (const MLReceiptPolicy &);
633 virtual ~MLReceiptPolicy();
634
635 virtual AsnType *Clone() const;
636
637 virtual AsnType *Copy() const;
638
639 MLReceiptPolicy &operator = (const MLReceiptPolicy &);
640 AsnLen BEncContent (BUF_TYPE b);
641 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
642 AsnLen BEnc (BUF_TYPE b);
643 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
644 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
645 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
646
647 void Print (ostream &os) const;
648 };
649
650
651 class ESSCertID: public AsnType
652 {
653 public:
654 CertHash certHash;
655 IssuerSerial *issuerSerial;
656
657 ESSCertID();
658 ESSCertID (const ESSCertID &);
659 virtual ~ESSCertID();
660 virtual AsnType *Clone() const;
661
662 virtual AsnType *Copy() const;
663
664 ESSCertID &operator = (const ESSCertID &);
665 AsnLen BEncContent (BUF_TYPE b);
666 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
667
668 AsnLen BEnc (BUF_TYPE b);
669 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
670 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
671 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
672
673 void Print (ostream &os) const;
674 };
675
676
677 class SigningCertificateSeqOf: public AsnType
678 {
679 protected:
680 unsigned long int count;
681 struct AsnListElmt
682 {
683 AsnListElmt *next;
684 AsnListElmt *prev;
685 ESSCertID *elmt;
686 } *first, *curr, *last;
687
688 public:
689 SigningCertificateSeqOf() { count = 0; first = curr = last = NULL; }
690 SigningCertificateSeqOf (const SigningCertificateSeqOf &);
691 virtual ~SigningCertificateSeqOf();
692 virtual AsnType *Clone() const;
693
694 virtual AsnType *Copy() const;
695
696 SigningCertificateSeqOf &operator = (const SigningCertificateSeqOf &);
697 void SetCurrElmt (unsigned long int index);
698 unsigned long int GetCurrElmtIndex();
699 void SetCurrToFirst() { curr = first; }
700 void SetCurrToLast() { curr = last; }
701 // reading member fcns
702 int Count() const { return count; }
703 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
704 ESSCertID *First() const { return count > 0 ? first->elmt : NULL; }
705 ESSCertID *Last() const { return count > 0 ? last->elmt : NULL; }
706 ESSCertID *Curr() const { return curr ? curr->elmt : NULL; }
707 ESSCertID *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
708 ESSCertID *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
709
710 // routines that move the curr elmt
711 ESSCertID *GoNext() { if (curr) curr = curr->next; return Curr(); }
712 ESSCertID *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
713
714 // write & alloc fcns - returns new elmt
715 ESSCertID *Append(); // add elmt to end of list
716 ESSCertID *Prepend(); // add elmt to beginning of list
717 ESSCertID *InsertBefore(); //insert elmt before current elmt
718 ESSCertID *InsertAfter(); //insert elmt after current elmt
719
720 // write & alloc & copy - returns list after copying elmt
721 SigningCertificateSeqOf &AppendCopy (ESSCertID &elmt); // add elmt to end of list
722 SigningCertificateSeqOf &PrependCopy (ESSCertID &elmt); // add elmt to beginning of list
723 SigningCertificateSeqOf &InsertBeforeAndCopy (ESSCertID &elmt); //insert elmt before current elmt
724 SigningCertificateSeqOf &InsertAfterAndCopy (ESSCertID &elmt); //insert elmt after current elmt
725
726 // removing the current elmt from the list
727 void RemoveCurrFromList();
728
729 // encode and decode routines
730 AsnLen BEnc (BUF_TYPE b);
731 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
732 AsnLen BEncContent (BUF_TYPE b);
733 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
734
735 PDU_MEMBER_MACROS
736 void Print (ostream &os) const;
737 };
738
739
740 class ESSSecurityLabel: public AsnType
741 {
742 public:
743 SecurityPolicyIdentifier security_policy_identifier;
744 SecurityClassification *security_classification;
745 ESSPrivacyMark *privacy_mark;
746 SecurityCategories *security_categories;
747
748 ESSSecurityLabel();
749 ESSSecurityLabel (const ESSSecurityLabel &);
750 virtual ~ESSSecurityLabel();
751 virtual AsnType *Clone() const;
752
753 virtual AsnType *Copy() const;
754
755 ESSSecurityLabel &operator = (const ESSSecurityLabel &);
756 AsnLen BEncContent (BUF_TYPE b);
757 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
758
759 AsnLen BEnc (BUF_TYPE b);
760 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
761 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
762 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
763
764 void Print (ostream &os) const;
765 };
766
767
768 class MLData: public AsnType
769 {
770 public:
771 EntityIdentifier *mailListIdentifier;
772 GeneralizedTime expansionTime;
773 MLReceiptPolicy *mlReceiptPolicy;
774
775 MLData();
776 MLData (const MLData &);
777 virtual ~MLData();
778 virtual AsnType *Clone() const;
779
780 virtual AsnType *Copy() const;
781
782 MLData &operator = (const MLData &);
783 AsnLen BEncContent (BUF_TYPE b);
784 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
785
786 AsnLen BEnc (BUF_TYPE b);
787 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
788 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
789 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
790
791 void Print (ostream &os) const;
792 };
793
794
795 class ReceiptRequest: public AsnType
796 {
797 public:
798 ContentIdentifier signedContentIdentifier;
799 ReceiptsFrom *receiptsFrom;
800 ReceiptRequestSeqOf receiptsTo;
801
802 ReceiptRequest();
803 ReceiptRequest (const ReceiptRequest &);
804 virtual ~ReceiptRequest();
805 virtual AsnType *Clone() const;
806
807 virtual AsnType *Copy() const;
808
809 ReceiptRequest &operator = (const ReceiptRequest &);
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);
815 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
816 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
817
818 void Print (ostream &os) const;
819 };
820
821
822 class Receipt: public AsnType
823 {
824 public:
825 CMSVersion version;
826 ContentType contentType;
827 ContentIdentifier signedContentIdentifier;
828 AsnOcts originatorSignatureValue;
829
830 Receipt();
831 Receipt (const Receipt &);
832 virtual ~Receipt();
833 virtual AsnType *Clone() const;
834
835 virtual AsnType *Copy() const;
836
837 Receipt &operator = (const Receipt &);
838 AsnLen BEncContent (BUF_TYPE b);
839 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
840
841 AsnLen BEnc (BUF_TYPE b);
842 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
843 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
844 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
845
846 void Print (ostream &os) const;
847 };
848
849
850 class ContentHints: public AsnType
851 {
852 public:
853 UTF8String *contentDescription;
854 ContentType contentType;
855
856 ContentHints();
857 ContentHints (const ContentHints &);
858 virtual ~ContentHints();
859 virtual AsnType *Clone() const;
860
861 virtual AsnType *Copy() const;
862
863 ContentHints &operator = (const ContentHints &);
864 AsnLen BEncContent (BUF_TYPE b);
865 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
866
867 AsnLen BEnc (BUF_TYPE b);
868 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
869 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
870 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
871
872 void Print (ostream &os) const;
873 };
874
875
876 class ContentReference: public AsnType
877 {
878 public:
879 ContentType contentType;
880 ContentIdentifier signedContentIdentifier;
881 AsnOcts originatorSignatureValue;
882
883 ContentReference();
884 ContentReference (const ContentReference &);
885 virtual ~ContentReference();
886 virtual AsnType *Clone() const;
887
888 virtual AsnType *Copy() const;
889
890 ContentReference &operator = (const ContentReference &);
891 AsnLen BEncContent (BUF_TYPE b);
892 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
893
894 AsnLen BEnc (BUF_TYPE b);
895 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
896 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
897 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
898
899 void Print (ostream &os) const;
900 };
901
902
903 class EquivalentLabels: public AsnType
904 {
905 protected:
906 unsigned long int count;
907 struct AsnListElmt
908 {
909 AsnListElmt *next;
910 AsnListElmt *prev;
911 ESSSecurityLabel *elmt;
912 } *first, *curr, *last;
913
914 public:
915 EquivalentLabels() { count = 0; first = curr = last = NULL; }
916 EquivalentLabels (const EquivalentLabels &);
917 virtual ~EquivalentLabels();
918 virtual AsnType *Clone() const;
919
920 virtual AsnType *Copy() const;
921
922 EquivalentLabels &operator = (const EquivalentLabels &);
923 void SetCurrElmt (unsigned long int index);
924 unsigned long int GetCurrElmtIndex();
925 void SetCurrToFirst() { curr = first; }
926 void SetCurrToLast() { curr = last; }
927 // reading member fcns
928 int Count() const { return count; }
929 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
930 ESSSecurityLabel *First() const { return count > 0 ? first->elmt : NULL; }
931 ESSSecurityLabel *Last() const { return count > 0 ? last->elmt : NULL; }
932 ESSSecurityLabel *Curr() const { return curr ? curr->elmt : NULL; }
933 ESSSecurityLabel *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
934 ESSSecurityLabel *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
935
936 // routines that move the curr elmt
937 ESSSecurityLabel *GoNext() { if (curr) curr = curr->next; return Curr(); }
938 ESSSecurityLabel *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
939
940 // write & alloc fcns - returns new elmt
941 ESSSecurityLabel *Append(); // add elmt to end of list
942 ESSSecurityLabel *Prepend(); // add elmt to beginning of list
943 ESSSecurityLabel *InsertBefore(); //insert elmt before current elmt
944 ESSSecurityLabel *InsertAfter(); //insert elmt after current elmt
945
946 // write & alloc & copy - returns list after copying elmt
947 EquivalentLabels &AppendCopy (ESSSecurityLabel &elmt); // add elmt to end of list
948 EquivalentLabels &PrependCopy (ESSSecurityLabel &elmt); // add elmt to beginning of list
949 EquivalentLabels &InsertBeforeAndCopy (ESSSecurityLabel &elmt); //insert elmt before current elmt
950 EquivalentLabels &InsertAfterAndCopy (ESSSecurityLabel &elmt); //insert elmt after current elmt
951
952 // removing the current elmt from the list
953 void RemoveCurrFromList();
954
955 // encode and decode routines
956 AsnLen BEnc (BUF_TYPE b);
957 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
958 AsnLen BEncContent (BUF_TYPE b);
959 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
960
961 PDU_MEMBER_MACROS
962 void Print (ostream &os) const;
963 };
964
965
966 class MLExpansionHistory: public AsnType
967 {
968 protected:
969 unsigned long int count;
970 struct AsnListElmt
971 {
972 AsnListElmt *next;
973 AsnListElmt *prev;
974 MLData *elmt;
975 } *first, *curr, *last;
976
977 public:
978 MLExpansionHistory() { count = 0; first = curr = last = NULL; }
979 MLExpansionHistory (const MLExpansionHistory &);
980 virtual ~MLExpansionHistory();
981 virtual AsnType *Clone() const;
982
983 virtual AsnType *Copy() const;
984
985 MLExpansionHistory &operator = (const MLExpansionHistory &);
986 void SetCurrElmt (unsigned long int index);
987 unsigned long int GetCurrElmtIndex();
988 void SetCurrToFirst() { curr = first; }
989 void SetCurrToLast() { curr = last; }
990 // reading member fcns
991 int Count() const { return count; }
992 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
993 MLData *First() const { return count > 0 ? first->elmt : NULL; }
994 MLData *Last() const { return count > 0 ? last->elmt : NULL; }
995 MLData *Curr() const { return curr ? curr->elmt : NULL; }
996 MLData *Next() const { return curr && curr->next ? curr->next->elmt : NULL; }
997 MLData *Prev() const { return curr && curr->prev ? curr->prev->elmt : NULL; }
998
999 // routines that move the curr elmt
1000 MLData *GoNext() { if (curr) curr = curr->next; return Curr(); }
1001 MLData *GoPrev() { if (curr) curr = curr->prev; return Curr(); }
1002
1003 // write & alloc fcns - returns new elmt
1004 MLData *Append(); // add elmt to end of list
1005 MLData *Prepend(); // add elmt to beginning of list
1006 MLData *InsertBefore(); //insert elmt before current elmt
1007 MLData *InsertAfter(); //insert elmt after current elmt
1008
1009 // write & alloc & copy - returns list after copying elmt
1010 MLExpansionHistory &AppendCopy (MLData &elmt); // add elmt to end of list
1011 MLExpansionHistory &PrependCopy (MLData &elmt); // add elmt to beginning of list
1012 MLExpansionHistory &InsertBeforeAndCopy (MLData &elmt); //insert elmt before current elmt
1013 MLExpansionHistory &InsertAfterAndCopy (MLData &elmt); //insert elmt after current elmt
1014
1015 // removing the current elmt from the list
1016 void RemoveCurrFromList();
1017
1018 // encode and decode routines
1019 AsnLen BEnc (BUF_TYPE b);
1020 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
1021 AsnLen BEncContent (BUF_TYPE b);
1022 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
1023
1024 PDU_MEMBER_MACROS
1025 void Print (ostream &os) const;
1026 };
1027
1028
1029 class SigningCertificate: public AsnType
1030 {
1031 public:
1032 SigningCertificateSeqOf certs;
1033 SigningCertificateSeqOf1 *policies;
1034
1035 SigningCertificate();
1036 SigningCertificate (const SigningCertificate &);
1037 virtual ~SigningCertificate();
1038 virtual AsnType *Clone() const;
1039
1040 virtual AsnType *Copy() const;
1041
1042 SigningCertificate &operator = (const SigningCertificate &);
1043 AsnLen BEncContent (BUF_TYPE b);
1044 void BDecContent (BUF_TYPE b, AsnTag tag, AsnLen elmtLen, AsnLen &bytesDecoded, ENV_TYPE env);
1045
1046 AsnLen BEnc (BUF_TYPE b);
1047 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
1048 int BEncPdu (BUF_TYPE b, AsnLen &bytesEncoded);
1049 int BDecPdu (BUF_TYPE b, AsnLen &bytesDecoded);
1050
1051 void Print (ostream &os) const;
1052 };
1053
1054
1055 //------------------------------------------------------------------------------
1056 // externs for value defs
1057
1058 #define ub_receiptsTo_val 16
1059 #define ub_receiptsTo AsnInt(ub_receiptsTo_val)
1060 #define smime_arc 1, 2, 840, 113549, 1, 9, 16
1061 #define smime AsnOid(smime_arc)
1062 #define id_aa_arc 1, 2, 840, 113549, 1, 9, 16, 2
1063 #define id_aa AsnOid(id_aa_arc)
1064 #define id_aa_receiptRequest_arc 1, 2, 840, 113549, 1, 9, 16, 2, 1
1065 #define id_aa_receiptRequest AsnOid(id_aa_receiptRequest_arc)
1066 #define id_aa_contentIdentifier_arc 1, 2, 840, 113549, 1, 9, 16, 2, 7
1067 #define id_aa_contentIdentifier AsnOid(id_aa_contentIdentifier_arc)
1068 #define id_ct_receipt_arc 1, 2, 840, 113549, 1, 9, 16, 1, 1
1069 #define id_ct_receipt AsnOid(id_ct_receipt_arc)
1070 #define id_aa_contentHint_arc 1, 2, 840, 113549, 1, 9, 16, 2, 4
1071 #define id_aa_contentHint AsnOid(id_aa_contentHint_arc)
1072 #define id_aa_msgSigDigest_arc 1, 2, 840, 113549, 1, 9, 16, 2, 5
1073 #define id_aa_msgSigDigest AsnOid(id_aa_msgSigDigest_arc)
1074 #define id_aa_contentReference_arc 1, 2, 840, 113549, 1, 9, 16, 2, 10
1075 #define id_aa_contentReference AsnOid(id_aa_contentReference_arc)
1076 #define id_aa_securityLabel_arc 1, 2, 840, 113549, 1, 9, 16, 2, 2
1077 #define id_aa_securityLabel AsnOid(id_aa_securityLabel_arc)
1078 #define id_aa_equivalentLabels_arc 1, 2, 840, 113549, 1, 9, 16, 2, 9
1079 #define id_aa_equivalentLabels AsnOid(id_aa_equivalentLabels_arc)
1080 #define id_aa_mlExpandHistory_arc 1, 2, 840, 113549, 1, 9, 16, 2, 3
1081 #define id_aa_mlExpandHistory AsnOid(id_aa_mlExpandHistory_arc)
1082 #define ub_ml_expansion_history_val 64
1083 #define ub_ml_expansion_history AsnInt(ub_ml_expansion_history_val)
1084 #define id_aa_signingCertificate_arc 1, 2, 840, 113549, 1, 9, 16, 2, 4444
1085 #define id_aa_signingCertificate AsnOid(id_aa_signingCertificate_arc)
1086 #define id_pkix_arc 1, 3, 6, 1, 5, 5, 7
1087 #define id_pkix AsnOid(id_pkix_arc)
1088 #define id_qt_arc 1, 3, 6, 1, 5, 5, 7, 2
1089 #define id_qt AsnOid(id_qt_arc)
1090 #define id_qt_cps_arc 1, 3, 6, 1, 5, 5, 7, 2, 1
1091 #define id_qt_cps AsnOid(id_qt_cps_arc)
1092 #define id_qt_unotice_arc 1, 3, 6, 1, 5, 5, 7, 2, 2
1093 #define id_qt_unotice AsnOid(id_qt_unotice_arc)
1094 //------------------------------------------------------------------------------
1095
1096 #endif /* conditional include of sm_ess.h */