1 // NOTE: this is a machine generated file--editing not recommended
3 // sm_x509ce.h - class definitions for ASN.1 module CertificateExtensions
5 // This file was generated by snacc on Mon Apr 22 22:34:19 2002
6 // UBC snacc by Mike Sample
7 // A couple of enhancements made by IBM European Networking Center
13 //------------------------------------------------------------------------------
14 // class declarations:
19 class PolicyQualifierInfo
;
20 class AttributesSyntax
;
21 class DistributionPointName
;
22 class PolicyMappingsSyntaxSeq
;
23 class PolicyInformationSeqOf
;
24 class PolicyInformation
;
26 class DistributionPoint
;
27 class CertificatePoliciesSyntax
;
28 class GeneralSubtrees
;
29 class AuthorityKeyIdentifier
;
30 class ExtKeyUsageSyntax
;
31 class PrivateKeyUsagePeriod
;
32 class PolicyMappingsSyntax
;
33 class SupportedAlgorithm
;
34 class BasicConstraintsSyntax
;
35 class NameConstraintsSyntax
;
36 class PolicyConstraintsSyntax
;
38 class CRLDistPointsSyntax
;
39 class IssuingDistPointSyntax
;
41 //------------------------------------------------------------------------------
44 typedef enum CertificateExtensionsAnyId
47 } CertificateExtensionsAnyId
;
51 typedef AsnOcts KeyIdentifier
;
53 /* BIT STRING { digitalSignature (0), nonRepudiation (1), keyEncipherment (2), dataEncipherment (3), keyAgreement (4), keyCertSign (5), cRLSign (6), encipherOnly (7), decipherOnly (8) } */
54 class KeyUsage
: public AsnBits
57 KeyUsage(): AsnBits() {}
58 KeyUsage (const size_t bits
): AsnBits (bits
) {}
59 KeyUsage (const char *str
, const size_t bitLen
): AsnBits (str
, bitLen
) {}
60 KeyUsage (const AsnBits
&b
): AsnBits (b
) {}
76 /* OBJECT IDENTIFIER */
77 typedef AsnOid KeyPurposeId
;
79 /* OBJECT IDENTIFIER */
80 typedef AsnOid CertPolicyId
;
82 /* INTEGER (0..MAX) */
83 typedef AsnInt BaseDistance
;
85 /* INTEGER (0..MAX) */
86 typedef AsnInt SkipCerts
;
88 /* INTEGER (0..MAX) */
89 typedef AsnInt CRLNumber
;
91 /* ENUMERATED { unspecified (0), keyCompromise (1), cACompromise (2), affiliationChanged (3), superseded (4), cessationOfOperation (5), certificateHold (6), removeFromCRL (8) } */
92 class CRLReason
: public AsnEnum
95 CRLReason(): AsnEnum() {}
96 CRLReason (int i
): AsnEnum (i
) {}
102 affiliationChanged
= 3,
104 cessationOfOperation
= 5,
111 /* OBJECT IDENTIFIER */
112 typedef AsnOid HoldInstruction
;
114 /* BIT STRING { unused (0), keyCompromise (1), caCompromise (2), affiliationChanged (3), superseded (4), cessationOfOperation (5), certificateHold (6) } */
115 class ReasonFlags
: public AsnBits
118 ReasonFlags(): AsnBits() {}
119 ReasonFlags (const size_t bits
): AsnBits (bits
) {}
120 ReasonFlags (const char *str
, const size_t bitLen
): AsnBits (str
, bitLen
) {}
121 ReasonFlags (const AsnBits
&b
): AsnBits (b
) {}
127 affiliationChanged
= 3,
129 cessationOfOperation
= 5,
135 class PolicyQualifierInfo
: public AsnType
138 AsnOid policyQualifierId
;
141 PolicyQualifierInfo();
142 PolicyQualifierInfo (const PolicyQualifierInfo
&);
143 virtual ~PolicyQualifierInfo();
144 virtual AsnType
*Clone() const;
146 virtual AsnType
*Copy() const;
148 PolicyQualifierInfo
&operator = (const PolicyQualifierInfo
&);
149 AsnLen
BEncContent (BUF_TYPE b
);
150 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
152 AsnLen
BEnc (BUF_TYPE b
);
153 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
154 void Print (ostream
&os
) const;
158 class AttributesSyntax
: public AsnType
161 unsigned long int count
;
167 } *first
, *curr
, *last
;
170 AttributesSyntax() { count
= 0; first
= curr
= last
= NULL
; }
171 AttributesSyntax (const AttributesSyntax
&);
172 virtual ~AttributesSyntax();
173 virtual AsnType
*Clone() const;
175 virtual AsnType
*Copy() const;
177 AttributesSyntax
&operator = (const AttributesSyntax
&);
178 void SetCurrElmt (unsigned long int index
);
179 unsigned long int GetCurrElmtIndex();
180 void SetCurrToFirst() { curr
= first
; }
181 void SetCurrToLast() { curr
= last
; }
182 // reading member fcns
183 int Count() const { return count
; }
184 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
185 Attribute
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
186 Attribute
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
187 Attribute
*Curr() const { return curr
? curr
->elmt
: NULL
; }
188 Attribute
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
189 Attribute
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
191 // routines that move the curr elmt
192 Attribute
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
193 Attribute
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
195 // write & alloc fcns - returns new elmt
196 Attribute
*Append(); // add elmt to end of list
197 Attribute
*Prepend(); // add elmt to beginning of list
198 Attribute
*InsertBefore(); //insert elmt before current elmt
199 Attribute
*InsertAfter(); //insert elmt after current elmt
201 // write & alloc & copy - returns list after copying elmt
202 AttributesSyntax
&AppendCopy (Attribute
&elmt
); // add elmt to end of list
203 AttributesSyntax
&PrependCopy (Attribute
&elmt
); // add elmt to beginning of list
204 AttributesSyntax
&InsertBeforeAndCopy (Attribute
&elmt
); //insert elmt before current elmt
205 AttributesSyntax
&InsertAfterAndCopy (Attribute
&elmt
); //insert elmt after current elmt
207 // removing the current elmt from the list
208 void RemoveCurrFromList();
210 // encode and decode routines
211 AsnLen
BEnc (BUF_TYPE b
);
212 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
213 AsnLen
BEncContent (BUF_TYPE b
);
214 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
217 void Print (ostream
&os
) const;
221 class DistributionPointName
: public AsnType
227 nameRelativeToCRLIssuerCid
= 1
230 enum ChoiceIdEnum choiceId
;
233 GeneralNames
*fullName
;
234 RelativeDistinguishedName
*nameRelativeToCRLIssuer
;
238 DistributionPointName();
239 DistributionPointName (const DistributionPointName
&);
240 virtual ~DistributionPointName();
242 virtual AsnType
*Clone() const;
244 virtual AsnType
*Copy() const;
246 DistributionPointName
&operator = (const DistributionPointName
&);
247 AsnLen
BEncContent (BUF_TYPE b
);
248 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
249 AsnLen
BEnc (BUF_TYPE b
);
250 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
251 void Print (ostream
&os
) const;
255 class PolicyMappingsSyntaxSeq
: public AsnType
258 CertPolicyId issuerDomainPolicy
;
259 CertPolicyId subjectDomainPolicy
;
261 PolicyMappingsSyntaxSeq();
262 PolicyMappingsSyntaxSeq (const PolicyMappingsSyntaxSeq
&);
263 virtual ~PolicyMappingsSyntaxSeq();
264 virtual AsnType
*Clone() const;
266 virtual AsnType
*Copy() const;
268 PolicyMappingsSyntaxSeq
&operator = (const PolicyMappingsSyntaxSeq
&);
269 AsnLen
BEncContent (BUF_TYPE b
);
270 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
272 AsnLen
BEnc (BUF_TYPE b
);
273 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
274 void Print (ostream
&os
) const;
278 class PolicyInformationSeqOf
: public AsnType
281 unsigned long int count
;
286 PolicyQualifierInfo
*elmt
;
287 } *first
, *curr
, *last
;
290 PolicyInformationSeqOf() { count
= 0; first
= curr
= last
= NULL
; }
291 PolicyInformationSeqOf (const PolicyInformationSeqOf
&);
292 virtual ~PolicyInformationSeqOf();
293 virtual AsnType
*Clone() const;
295 virtual AsnType
*Copy() const;
297 PolicyInformationSeqOf
&operator = (const PolicyInformationSeqOf
&);
298 void SetCurrElmt (unsigned long int index
);
299 unsigned long int GetCurrElmtIndex();
300 void SetCurrToFirst() { curr
= first
; }
301 void SetCurrToLast() { curr
= last
; }
302 // reading member fcns
303 int Count() const { return count
; }
304 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
305 PolicyQualifierInfo
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
306 PolicyQualifierInfo
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
307 PolicyQualifierInfo
*Curr() const { return curr
? curr
->elmt
: NULL
; }
308 PolicyQualifierInfo
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
309 PolicyQualifierInfo
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
311 // routines that move the curr elmt
312 PolicyQualifierInfo
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
313 PolicyQualifierInfo
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
315 // write & alloc fcns - returns new elmt
316 PolicyQualifierInfo
*Append(); // add elmt to end of list
317 PolicyQualifierInfo
*Prepend(); // add elmt to beginning of list
318 PolicyQualifierInfo
*InsertBefore(); //insert elmt before current elmt
319 PolicyQualifierInfo
*InsertAfter(); //insert elmt after current elmt
321 // write & alloc & copy - returns list after copying elmt
322 PolicyInformationSeqOf
&AppendCopy (PolicyQualifierInfo
&elmt
); // add elmt to end of list
323 PolicyInformationSeqOf
&PrependCopy (PolicyQualifierInfo
&elmt
); // add elmt to beginning of list
324 PolicyInformationSeqOf
&InsertBeforeAndCopy (PolicyQualifierInfo
&elmt
); //insert elmt before current elmt
325 PolicyInformationSeqOf
&InsertAfterAndCopy (PolicyQualifierInfo
&elmt
); //insert elmt after current elmt
327 // removing the current elmt from the list
328 void RemoveCurrFromList();
330 // encode and decode routines
331 AsnLen
BEnc (BUF_TYPE b
);
332 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
333 AsnLen
BEncContent (BUF_TYPE b
);
334 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
337 void Print (ostream
&os
) const;
341 class PolicyInformation
: public AsnType
344 CertPolicyId policyIdentifier
;
345 PolicyInformationSeqOf
*policyQualifiers
;
348 PolicyInformation (const PolicyInformation
&);
349 virtual ~PolicyInformation();
350 virtual AsnType
*Clone() const;
352 virtual AsnType
*Copy() const;
354 PolicyInformation
&operator = (const PolicyInformation
&);
355 AsnLen
BEncContent (BUF_TYPE b
);
356 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
358 AsnLen
BEnc (BUF_TYPE b
);
359 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
360 void Print (ostream
&os
) const;
364 class GeneralSubtree
: public AsnType
368 BaseDistance
*minimum
;
369 BaseDistance
*maximum
;
372 GeneralSubtree (const GeneralSubtree
&);
373 virtual ~GeneralSubtree();
374 virtual AsnType
*Clone() const;
376 virtual AsnType
*Copy() const;
378 GeneralSubtree
&operator = (const GeneralSubtree
&);
379 AsnLen
BEncContent (BUF_TYPE b
);
380 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
382 AsnLen
BEnc (BUF_TYPE b
);
383 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
384 void Print (ostream
&os
) const;
388 class DistributionPoint
: public AsnType
391 DistributionPointName
*distributionPoint
;
392 ReasonFlags
*reasons
;
393 GeneralNames
*cRLIssuer
;
396 DistributionPoint (const DistributionPoint
&);
397 virtual ~DistributionPoint();
398 virtual AsnType
*Clone() const;
400 virtual AsnType
*Copy() const;
402 DistributionPoint
&operator = (const DistributionPoint
&);
403 AsnLen
BEncContent (BUF_TYPE b
);
404 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
406 AsnLen
BEnc (BUF_TYPE b
);
407 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
408 void Print (ostream
&os
) const;
412 class CertificatePoliciesSyntax
: public AsnType
415 unsigned long int count
;
420 PolicyInformation
*elmt
;
421 } *first
, *curr
, *last
;
424 CertificatePoliciesSyntax() { count
= 0; first
= curr
= last
= NULL
; }
425 CertificatePoliciesSyntax (const CertificatePoliciesSyntax
&);
426 virtual ~CertificatePoliciesSyntax();
427 virtual AsnType
*Clone() const;
429 virtual AsnType
*Copy() const;
431 CertificatePoliciesSyntax
&operator = (const CertificatePoliciesSyntax
&);
432 void SetCurrElmt (unsigned long int index
);
433 unsigned long int GetCurrElmtIndex();
434 void SetCurrToFirst() { curr
= first
; }
435 void SetCurrToLast() { curr
= last
; }
436 // reading member fcns
437 int Count() const { return count
; }
438 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
439 PolicyInformation
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
440 PolicyInformation
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
441 PolicyInformation
*Curr() const { return curr
? curr
->elmt
: NULL
; }
442 PolicyInformation
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
443 PolicyInformation
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
445 // routines that move the curr elmt
446 PolicyInformation
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
447 PolicyInformation
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
449 // write & alloc fcns - returns new elmt
450 PolicyInformation
*Append(); // add elmt to end of list
451 PolicyInformation
*Prepend(); // add elmt to beginning of list
452 PolicyInformation
*InsertBefore(); //insert elmt before current elmt
453 PolicyInformation
*InsertAfter(); //insert elmt after current elmt
455 // write & alloc & copy - returns list after copying elmt
456 CertificatePoliciesSyntax
&AppendCopy (PolicyInformation
&elmt
); // add elmt to end of list
457 CertificatePoliciesSyntax
&PrependCopy (PolicyInformation
&elmt
); // add elmt to beginning of list
458 CertificatePoliciesSyntax
&InsertBeforeAndCopy (PolicyInformation
&elmt
); //insert elmt before current elmt
459 CertificatePoliciesSyntax
&InsertAfterAndCopy (PolicyInformation
&elmt
); //insert elmt after current elmt
461 // removing the current elmt from the list
462 void RemoveCurrFromList();
464 // encode and decode routines
465 AsnLen
BEnc (BUF_TYPE b
);
466 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
467 AsnLen
BEncContent (BUF_TYPE b
);
468 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
471 void Print (ostream
&os
) const;
475 class GeneralSubtrees
: public AsnType
478 unsigned long int count
;
483 GeneralSubtree
*elmt
;
484 } *first
, *curr
, *last
;
487 GeneralSubtrees() { count
= 0; first
= curr
= last
= NULL
; }
488 GeneralSubtrees (const GeneralSubtrees
&);
489 virtual ~GeneralSubtrees();
490 virtual AsnType
*Clone() const;
492 virtual AsnType
*Copy() const;
494 GeneralSubtrees
&operator = (const GeneralSubtrees
&);
495 void SetCurrElmt (unsigned long int index
);
496 unsigned long int GetCurrElmtIndex();
497 void SetCurrToFirst() { curr
= first
; }
498 void SetCurrToLast() { curr
= last
; }
499 // reading member fcns
500 int Count() const { return count
; }
501 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
502 GeneralSubtree
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
503 GeneralSubtree
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
504 GeneralSubtree
*Curr() const { return curr
? curr
->elmt
: NULL
; }
505 GeneralSubtree
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
506 GeneralSubtree
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
508 // routines that move the curr elmt
509 GeneralSubtree
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
510 GeneralSubtree
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
512 // write & alloc fcns - returns new elmt
513 GeneralSubtree
*Append(); // add elmt to end of list
514 GeneralSubtree
*Prepend(); // add elmt to beginning of list
515 GeneralSubtree
*InsertBefore(); //insert elmt before current elmt
516 GeneralSubtree
*InsertAfter(); //insert elmt after current elmt
518 // write & alloc & copy - returns list after copying elmt
519 GeneralSubtrees
&AppendCopy (GeneralSubtree
&elmt
); // add elmt to end of list
520 GeneralSubtrees
&PrependCopy (GeneralSubtree
&elmt
); // add elmt to beginning of list
521 GeneralSubtrees
&InsertBeforeAndCopy (GeneralSubtree
&elmt
); //insert elmt before current elmt
522 GeneralSubtrees
&InsertAfterAndCopy (GeneralSubtree
&elmt
); //insert elmt after current elmt
524 // removing the current elmt from the list
525 void RemoveCurrFromList();
527 // encode and decode routines
528 AsnLen
BEnc (BUF_TYPE b
);
529 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
530 AsnLen
BEncContent (BUF_TYPE b
);
531 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
534 void Print (ostream
&os
) const;
538 class AuthorityKeyIdentifier
: public AsnType
541 KeyIdentifier
*keyIdentifier
;
542 GeneralNames
*authorityCertIssuer
;
543 CertificateSerialNumber
*authorityCertSerialNumber
;
545 AuthorityKeyIdentifier();
546 AuthorityKeyIdentifier (const AuthorityKeyIdentifier
&);
547 virtual ~AuthorityKeyIdentifier();
548 virtual AsnType
*Clone() const;
550 virtual AsnType
*Copy() const;
552 AuthorityKeyIdentifier
&operator = (const AuthorityKeyIdentifier
&);
553 AsnLen
BEncContent (BUF_TYPE b
);
554 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
556 AsnLen
BEnc (BUF_TYPE b
);
557 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
558 void Print (ostream
&os
) const;
563 typedef KeyIdentifier SubjectKeyIdentifier
;
565 class ExtKeyUsageSyntax
: public AsnType
568 unsigned long int count
;
574 } *first
, *curr
, *last
;
577 ExtKeyUsageSyntax() { count
= 0; first
= curr
= last
= NULL
; }
578 ExtKeyUsageSyntax (const ExtKeyUsageSyntax
&);
579 virtual ~ExtKeyUsageSyntax();
580 virtual AsnType
*Clone() const;
582 virtual AsnType
*Copy() const;
584 ExtKeyUsageSyntax
&operator = (const ExtKeyUsageSyntax
&);
585 void SetCurrElmt (unsigned long int index
);
586 unsigned long int GetCurrElmtIndex();
587 void SetCurrToFirst() { curr
= first
; }
588 void SetCurrToLast() { curr
= last
; }
589 // reading member fcns
590 int Count() const { return count
; }
591 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
592 KeyPurposeId
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
593 KeyPurposeId
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
594 KeyPurposeId
*Curr() const { return curr
? curr
->elmt
: NULL
; }
595 KeyPurposeId
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
596 KeyPurposeId
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
598 // routines that move the curr elmt
599 KeyPurposeId
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
600 KeyPurposeId
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
602 // write & alloc fcns - returns new elmt
603 KeyPurposeId
*Append(); // add elmt to end of list
604 KeyPurposeId
*Prepend(); // add elmt to beginning of list
605 KeyPurposeId
*InsertBefore(); //insert elmt before current elmt
606 KeyPurposeId
*InsertAfter(); //insert elmt after current elmt
608 // write & alloc & copy - returns list after copying elmt
609 ExtKeyUsageSyntax
&AppendCopy (KeyPurposeId
&elmt
); // add elmt to end of list
610 ExtKeyUsageSyntax
&PrependCopy (KeyPurposeId
&elmt
); // add elmt to beginning of list
611 ExtKeyUsageSyntax
&InsertBeforeAndCopy (KeyPurposeId
&elmt
); //insert elmt before current elmt
612 ExtKeyUsageSyntax
&InsertAfterAndCopy (KeyPurposeId
&elmt
); //insert elmt after current elmt
614 // removing the current elmt from the list
615 void RemoveCurrFromList();
617 // encode and decode routines
618 AsnLen
BEnc (BUF_TYPE b
);
619 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
620 AsnLen
BEncContent (BUF_TYPE b
);
621 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
624 void Print (ostream
&os
) const;
628 class PrivateKeyUsagePeriod
: public AsnType
631 GeneralizedTime
*notBefore
;
632 GeneralizedTime
*notAfter
;
634 PrivateKeyUsagePeriod();
635 PrivateKeyUsagePeriod (const PrivateKeyUsagePeriod
&);
636 virtual ~PrivateKeyUsagePeriod();
637 virtual AsnType
*Clone() const;
639 virtual AsnType
*Copy() const;
641 PrivateKeyUsagePeriod
&operator = (const PrivateKeyUsagePeriod
&);
642 AsnLen
BEncContent (BUF_TYPE b
);
643 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
645 AsnLen
BEnc (BUF_TYPE b
);
646 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
647 void Print (ostream
&os
) const;
651 class PolicyMappingsSyntax
: public AsnType
654 unsigned long int count
;
659 PolicyMappingsSyntaxSeq
*elmt
;
660 } *first
, *curr
, *last
;
663 PolicyMappingsSyntax() { count
= 0; first
= curr
= last
= NULL
; }
664 PolicyMappingsSyntax (const PolicyMappingsSyntax
&);
665 virtual ~PolicyMappingsSyntax();
666 virtual AsnType
*Clone() const;
668 virtual AsnType
*Copy() const;
670 PolicyMappingsSyntax
&operator = (const PolicyMappingsSyntax
&);
671 void SetCurrElmt (unsigned long int index
);
672 unsigned long int GetCurrElmtIndex();
673 void SetCurrToFirst() { curr
= first
; }
674 void SetCurrToLast() { curr
= last
; }
675 // reading member fcns
676 int Count() const { return count
; }
677 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
678 PolicyMappingsSyntaxSeq
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
679 PolicyMappingsSyntaxSeq
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
680 PolicyMappingsSyntaxSeq
*Curr() const { return curr
? curr
->elmt
: NULL
; }
681 PolicyMappingsSyntaxSeq
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
682 PolicyMappingsSyntaxSeq
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
684 // routines that move the curr elmt
685 PolicyMappingsSyntaxSeq
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
686 PolicyMappingsSyntaxSeq
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
688 // write & alloc fcns - returns new elmt
689 PolicyMappingsSyntaxSeq
*Append(); // add elmt to end of list
690 PolicyMappingsSyntaxSeq
*Prepend(); // add elmt to beginning of list
691 PolicyMappingsSyntaxSeq
*InsertBefore(); //insert elmt before current elmt
692 PolicyMappingsSyntaxSeq
*InsertAfter(); //insert elmt after current elmt
694 // write & alloc & copy - returns list after copying elmt
695 PolicyMappingsSyntax
&AppendCopy (PolicyMappingsSyntaxSeq
&elmt
); // add elmt to end of list
696 PolicyMappingsSyntax
&PrependCopy (PolicyMappingsSyntaxSeq
&elmt
); // add elmt to beginning of list
697 PolicyMappingsSyntax
&InsertBeforeAndCopy (PolicyMappingsSyntaxSeq
&elmt
); //insert elmt before current elmt
698 PolicyMappingsSyntax
&InsertAfterAndCopy (PolicyMappingsSyntaxSeq
&elmt
); //insert elmt after current elmt
700 // removing the current elmt from the list
701 void RemoveCurrFromList();
703 // encode and decode routines
704 AsnLen
BEnc (BUF_TYPE b
);
705 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
706 AsnLen
BEncContent (BUF_TYPE b
);
707 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
710 void Print (ostream
&os
) const;
714 class SupportedAlgorithm
: public AsnType
717 AlgorithmIdentifier
*algorithmIdentifier
;
718 KeyUsage
*intendedUsage
;
719 CertificatePoliciesSyntax
*intendedCertificatePolicies
;
721 SupportedAlgorithm();
722 SupportedAlgorithm (const SupportedAlgorithm
&);
723 virtual ~SupportedAlgorithm();
724 virtual AsnType
*Clone() const;
726 virtual AsnType
*Copy() const;
728 SupportedAlgorithm
&operator = (const SupportedAlgorithm
&);
729 AsnLen
BEncContent (BUF_TYPE b
);
730 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
732 AsnLen
BEnc (BUF_TYPE b
);
733 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
734 void Print (ostream
&os
) const;
739 typedef GeneralNames SubjectName
;
742 typedef GeneralNames IssuerAltName
;
744 /* AttributesSyntax */
745 typedef AttributesSyntax SubjectDirectoryAttributes
;
747 class BasicConstraintsSyntax
: public AsnType
751 AsnInt
*pathLenConstraint
;
753 BasicConstraintsSyntax();
754 BasicConstraintsSyntax (const BasicConstraintsSyntax
&);
755 virtual ~BasicConstraintsSyntax();
756 virtual AsnType
*Clone() const;
758 virtual AsnType
*Copy() const;
760 BasicConstraintsSyntax
&operator = (const BasicConstraintsSyntax
&);
761 AsnLen
BEncContent (BUF_TYPE b
);
762 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
764 AsnLen
BEnc (BUF_TYPE b
);
765 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
766 void Print (ostream
&os
) const;
770 class NameConstraintsSyntax
: public AsnType
773 GeneralSubtrees
*permittedSubtrees
;
774 GeneralSubtrees
*excludedSubtrees
;
776 NameConstraintsSyntax();
777 NameConstraintsSyntax (const NameConstraintsSyntax
&);
778 virtual ~NameConstraintsSyntax();
779 virtual AsnType
*Clone() const;
781 virtual AsnType
*Copy() const;
783 NameConstraintsSyntax
&operator = (const NameConstraintsSyntax
&);
784 AsnLen
BEncContent (BUF_TYPE b
);
785 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
787 AsnLen
BEnc (BUF_TYPE b
);
788 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
789 void Print (ostream
&os
) const;
793 class PolicyConstraintsSyntax
: public AsnType
796 SkipCerts
*requireExplicitPolicy
;
797 SkipCerts
*inhibitPolicyMapping
;
799 PolicyConstraintsSyntax();
800 PolicyConstraintsSyntax (const PolicyConstraintsSyntax
&);
801 virtual ~PolicyConstraintsSyntax();
802 virtual AsnType
*Clone() const;
804 virtual AsnType
*Copy() const;
806 PolicyConstraintsSyntax
&operator = (const PolicyConstraintsSyntax
&);
807 AsnLen
BEncContent (BUF_TYPE b
);
808 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
810 AsnLen
BEnc (BUF_TYPE b
);
811 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
812 void Print (ostream
&os
) const;
816 class CertPolicySet
: public AsnType
819 unsigned long int count
;
825 } *first
, *curr
, *last
;
828 CertPolicySet() { count
= 0; first
= curr
= last
= NULL
; }
829 CertPolicySet (const CertPolicySet
&);
830 virtual ~CertPolicySet();
831 virtual AsnType
*Clone() const;
833 virtual AsnType
*Copy() const;
835 CertPolicySet
&operator = (const CertPolicySet
&);
836 void SetCurrElmt (unsigned long int index
);
837 unsigned long int GetCurrElmtIndex();
838 void SetCurrToFirst() { curr
= first
; }
839 void SetCurrToLast() { curr
= last
; }
840 // reading member fcns
841 int Count() const { return count
; }
842 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
843 CertPolicyId
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
844 CertPolicyId
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
845 CertPolicyId
*Curr() const { return curr
? curr
->elmt
: NULL
; }
846 CertPolicyId
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
847 CertPolicyId
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
849 // routines that move the curr elmt
850 CertPolicyId
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
851 CertPolicyId
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
853 // write & alloc fcns - returns new elmt
854 CertPolicyId
*Append(); // add elmt to end of list
855 CertPolicyId
*Prepend(); // add elmt to beginning of list
856 CertPolicyId
*InsertBefore(); //insert elmt before current elmt
857 CertPolicyId
*InsertAfter(); //insert elmt after current elmt
859 // write & alloc & copy - returns list after copying elmt
860 CertPolicySet
&AppendCopy (CertPolicyId
&elmt
); // add elmt to end of list
861 CertPolicySet
&PrependCopy (CertPolicyId
&elmt
); // add elmt to beginning of list
862 CertPolicySet
&InsertBeforeAndCopy (CertPolicyId
&elmt
); //insert elmt before current elmt
863 CertPolicySet
&InsertAfterAndCopy (CertPolicyId
&elmt
); //insert elmt after current elmt
865 // removing the current elmt from the list
866 void RemoveCurrFromList();
868 // encode and decode routines
869 AsnLen
BEnc (BUF_TYPE b
);
870 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
871 AsnLen
BEncContent (BUF_TYPE b
);
872 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
875 void Print (ostream
&os
) const;
879 /* GeneralizedTime */
880 typedef GeneralizedTime InvalidityDate
;
882 class CRLDistPointsSyntax
: public AsnType
885 unsigned long int count
;
890 DistributionPoint
*elmt
;
891 } *first
, *curr
, *last
;
894 CRLDistPointsSyntax() { count
= 0; first
= curr
= last
= NULL
; }
895 CRLDistPointsSyntax (const CRLDistPointsSyntax
&);
896 virtual ~CRLDistPointsSyntax();
897 virtual AsnType
*Clone() const;
899 virtual AsnType
*Copy() const;
901 CRLDistPointsSyntax
&operator = (const CRLDistPointsSyntax
&);
902 void SetCurrElmt (unsigned long int index
);
903 unsigned long int GetCurrElmtIndex();
904 void SetCurrToFirst() { curr
= first
; }
905 void SetCurrToLast() { curr
= last
; }
906 // reading member fcns
907 int Count() const { return count
; }
908 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
909 DistributionPoint
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
910 DistributionPoint
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
911 DistributionPoint
*Curr() const { return curr
? curr
->elmt
: NULL
; }
912 DistributionPoint
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
913 DistributionPoint
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
915 // routines that move the curr elmt
916 DistributionPoint
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
917 DistributionPoint
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
919 // write & alloc fcns - returns new elmt
920 DistributionPoint
*Append(); // add elmt to end of list
921 DistributionPoint
*Prepend(); // add elmt to beginning of list
922 DistributionPoint
*InsertBefore(); //insert elmt before current elmt
923 DistributionPoint
*InsertAfter(); //insert elmt after current elmt
925 // write & alloc & copy - returns list after copying elmt
926 CRLDistPointsSyntax
&AppendCopy (DistributionPoint
&elmt
); // add elmt to end of list
927 CRLDistPointsSyntax
&PrependCopy (DistributionPoint
&elmt
); // add elmt to beginning of list
928 CRLDistPointsSyntax
&InsertBeforeAndCopy (DistributionPoint
&elmt
); //insert elmt before current elmt
929 CRLDistPointsSyntax
&InsertAfterAndCopy (DistributionPoint
&elmt
); //insert elmt after current elmt
931 // removing the current elmt from the list
932 void RemoveCurrFromList();
934 // encode and decode routines
935 AsnLen
BEnc (BUF_TYPE b
);
936 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
937 AsnLen
BEncContent (BUF_TYPE b
);
938 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
941 void Print (ostream
&os
) const;
945 class IssuingDistPointSyntax
: public AsnType
948 DistributionPointName
*distributionPoint
;
949 AsnBool
*onlyContainsUserCerts
;
950 AsnBool
*onlyContainsCACerts
;
951 ReasonFlags
*onlySomeReasons
;
952 AsnBool
*indirectCRL
;
954 IssuingDistPointSyntax();
955 IssuingDistPointSyntax (const IssuingDistPointSyntax
&);
956 virtual ~IssuingDistPointSyntax();
957 virtual AsnType
*Clone() const;
959 virtual AsnType
*Copy() const;
961 IssuingDistPointSyntax
&operator = (const IssuingDistPointSyntax
&);
962 AsnLen
BEncContent (BUF_TYPE b
);
963 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
965 AsnLen
BEnc (BUF_TYPE b
);
966 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
967 void Print (ostream
&os
) const;
972 typedef GeneralNames CertificateIssuer
;
975 typedef CRLNumber BaseCRLNumber
;
977 /* CertificateList */
978 typedef CertificateList DeltaRevocationList
;
980 //------------------------------------------------------------------------------
981 // externs for value defs
983 #define id_at_supportedAlgorithms_arc 2, 5, 4, 52
984 #define id_at_supportedAlgorithms AsnOid(id_at_supportedAlgorithms_arc)
985 #define id_at_deltaRevocationList_arc 2, 5, 4, 53
986 #define id_at_deltaRevocationList AsnOid(id_at_deltaRevocationList_arc)
987 #define id_ce_subjectDirectoryAttributes_arc 2, 5, 29, 9
988 #define id_ce_subjectDirectoryAttributes AsnOid(id_ce_subjectDirectoryAttributes_arc)
989 #define id_ce_subjectKeyIdentifier_arc 2, 5, 29, 14
990 #define id_ce_subjectKeyIdentifier AsnOid(id_ce_subjectKeyIdentifier_arc)
991 #define id_ce_keyUsage_arc 2, 5, 29, 15
992 #define id_ce_keyUsage AsnOid(id_ce_keyUsage_arc)
993 #define id_ce_privateKeyUsagePeriod_arc 2, 5, 29, 16
994 #define id_ce_privateKeyUsagePeriod AsnOid(id_ce_privateKeyUsagePeriod_arc)
995 #define id_ce_subjectAltName_arc 2, 5, 29, 17
996 #define id_ce_subjectAltName AsnOid(id_ce_subjectAltName_arc)
997 #define id_ce_issuerAltName_arc 2, 5, 29, 18
998 #define id_ce_issuerAltName AsnOid(id_ce_issuerAltName_arc)
999 #define id_ce_basicConstraints_arc 2, 5, 29, 19
1000 #define id_ce_basicConstraints AsnOid(id_ce_basicConstraints_arc)
1001 #define id_ce_cRLNumber_arc 2, 5, 29, 20
1002 #define id_ce_cRLNumber AsnOid(id_ce_cRLNumber_arc)
1003 #define id_ce_reasonCode_arc 2, 5, 29, 21
1004 #define id_ce_reasonCode AsnOid(id_ce_reasonCode_arc)
1005 #define id_ce_instructionCode_arc 2, 5, 29, 23
1006 #define id_ce_instructionCode AsnOid(id_ce_instructionCode_arc)
1007 #define id_ce_invalidityDate_arc 2, 5, 29, 24
1008 #define id_ce_invalidityDate AsnOid(id_ce_invalidityDate_arc)
1009 #define id_ce_deltaCRLIndicator_arc 2, 5, 29, 27
1010 #define id_ce_deltaCRLIndicator AsnOid(id_ce_deltaCRLIndicator_arc)
1011 #define id_ce_issuingDistributionPoint_arc 2, 5, 29, 28
1012 #define id_ce_issuingDistributionPoint AsnOid(id_ce_issuingDistributionPoint_arc)
1013 #define id_ce_certificateIssuer_arc 2, 5, 29, 29
1014 #define id_ce_certificateIssuer AsnOid(id_ce_certificateIssuer_arc)
1015 #define id_ce_nameConstraints_arc 2, 5, 29, 30
1016 #define id_ce_nameConstraints AsnOid(id_ce_nameConstraints_arc)
1017 #define id_ce_cRLDistributionPoints_arc 2, 5, 29, 31
1018 #define id_ce_cRLDistributionPoints AsnOid(id_ce_cRLDistributionPoints_arc)
1019 #define id_ce_certificatePolicies_arc 2, 5, 29, 32
1020 #define id_ce_certificatePolicies AsnOid(id_ce_certificatePolicies_arc)
1021 #define id_ce_policyMappings_arc 2, 5, 29, 33
1022 #define id_ce_policyMappings AsnOid(id_ce_policyMappings_arc)
1023 #define id_ce_authorityKeyIdentifier_arc 2, 5, 29, 35
1024 #define id_ce_authorityKeyIdentifier AsnOid(id_ce_authorityKeyIdentifier_arc)
1025 #define id_ce_policyConstraints_arc 2, 5, 29, 36
1026 #define id_ce_policyConstraints AsnOid(id_ce_policyConstraints_arc)
1027 #define id_ce_extKeyUsage_arc 2, 5, 29, 37
1028 #define id_ce_extKeyUsage AsnOid(id_ce_extKeyUsage_arc)
1029 #define id_mr_certificateExactMatch_arc 2, 5, 13, 34
1030 #define id_mr_certificateExactMatch AsnOid(id_mr_certificateExactMatch_arc)
1031 #define id_mr_certificateMatch_arc 2, 5, 13, 35
1032 #define id_mr_certificateMatch AsnOid(id_mr_certificateMatch_arc)
1033 #define id_mr_certificatePairExactMatch_arc 2, 5, 13, 36
1034 #define id_mr_certificatePairExactMatch AsnOid(id_mr_certificatePairExactMatch_arc)
1035 #define id_mr_certificatePairMatch_arc 2, 5, 13, 37
1036 #define id_mr_certificatePairMatch AsnOid(id_mr_certificatePairMatch_arc)
1037 #define id_mr_certificateListExactMatch_arc 2, 5, 13, 38
1038 #define id_mr_certificateListExactMatch AsnOid(id_mr_certificateListExactMatch_arc)
1039 #define id_mr_certificateListMatch_arc 2, 5, 13, 39
1040 #define id_mr_certificateListMatch AsnOid(id_mr_certificateListMatch_arc)
1041 #define id_mr_algorithmIdentifierMatch_arc 2, 5, 13, 40
1042 #define id_mr_algorithmIdentifierMatch AsnOid(id_mr_algorithmIdentifierMatch_arc)
1043 #define id_kp_arc 1, 3, 6, 1, 5, 5, 7, 3
1044 #define id_kp AsnOid(id_kp_arc)
1045 #define id_kp_serverAuth_arc 1, 3, 6, 1, 5, 5, 7, 3, 1
1046 #define id_kp_serverAuth AsnOid(id_kp_serverAuth_arc)
1047 #define id_kp_clientAuth_arc 1, 3, 6, 1, 5, 5, 7, 3, 2
1048 #define id_kp_clientAuth AsnOid(id_kp_clientAuth_arc)
1049 #define id_kp_codeSigning_arc 1, 3, 6, 1, 5, 5, 7, 3, 3
1050 #define id_kp_codeSigning AsnOid(id_kp_codeSigning_arc)
1051 #define id_kp_emailProtection_arc 1, 3, 6, 1, 5, 5, 7, 3, 4
1052 #define id_kp_emailProtection AsnOid(id_kp_emailProtection_arc)
1053 #define id_kp_timeStamping_arc 1, 3, 6, 1, 5, 5, 7, 3, 8
1054 #define id_kp_timeStamping AsnOid(id_kp_timeStamping_arc)
1055 #define id_netscape_cert_type_arc 2, 16, 840, 1, 113730, 1, 1
1056 #define id_netscape_cert_type AsnOid(id_netscape_cert_type_arc)
1057 //------------------------------------------------------------------------------
1059 #endif /* conditional include of sm_x509ce.h */