1 // NOTE: this is a machine generated file--editing not recommended
3 // sm_x509af.cpp - class member functions for ASN.1 module AuthenticationFramework
5 // This file was generated by snacc on Wed Jun 27 16:40:55 2001
6 // UBC snacc written by Mike Sample
7 // A couple of enhancements made by IBM European Networking Center
11 #include "sm_vdatypes.h"
12 #include "sm_x501ud.h"
13 #include "sm_x411ub.h"
14 #include "sm_x411mtsas.h"
15 #include "sm_x501if.h"
16 #include "sm_x520sa.h"
17 #include "sm_x509cmn.h"
18 #include "sm_x509af.h"
19 #include "sm_x509ce.h"
20 #include "pkcs1oids.h"
21 #include "pkcs9oids.h"
26 #include "appleoids.h"
28 //------------------------------------------------------------------------------
32 //------------------------------------------------------------------------------
33 // class member definitions:
35 AsnType
*AttributeCertificateAssertionSetOf::Clone() const
37 return new AttributeCertificateAssertionSetOf
;
40 AsnType
*AttributeCertificateAssertionSetOf::Copy() const
42 return new AttributeCertificateAssertionSetOf (*this);
45 AsnLen
AttributeCertificateAssertionSetOf::BEnc (BUF_TYPE b
)
49 l
+= BEncConsLen (b
, l
);
50 l
+= BEncTag1 (b
, UNIV
, CONS
, SET_TAG_CODE
);
54 void AttributeCertificateAssertionSetOf::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
59 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SET_TAG_CODE
))
61 Asn1Error
<< "AttributeCertificateAssertionSetOf::BDec: ERROR - wrong tag" << endl
;
64 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
65 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
68 AttributeCertificateAssertionSetOf::AttributeCertificateAssertionSetOf (const AttributeCertificateAssertionSetOf
&)
70 Asn1Error
<< "use of incompletely defined AttributeCertificateAssertionSetOf::AttributeCertificateAssertionSetOf (const AttributeCertificateAssertionSetOf &)" << endl
;
74 AttributeCertificateAssertionSetOf::~AttributeCertificateAssertionSetOf()
77 for (; Curr() != NULL
; RemoveCurrFromList())
79 } // end of destructor
82 AttributeCertificateAssertionSetOf
&AttributeCertificateAssertionSetOf::operator = (const AttributeCertificateAssertionSetOf
&that
)
83 #else // SNACC_DEEP_COPY
84 AttributeCertificateAssertionSetOf
&AttributeCertificateAssertionSetOf::operator = (const AttributeCertificateAssertionSetOf
&)
85 #endif // SNACC_DEEP_COPY
91 for (; Curr(); RemoveCurrFromList())
94 //that.SetCurrToFirst();
95 //for (; that.Curr(); that.GoNext())
96 // AppendCopy (*that.Curr());
97 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
98 AppendCopy (*run
->elmt
);
102 #else // SNACC_DEEP_COPY
103 Asn1Error
<< "use of incompletely defined AttributeCertificateAssertionSetOf &AttributeCertificateAssertionSetOf::operator = (const AttributeCertificateAssertionSetOf &)" << endl
;
105 // if your compiler complains here, check the -novolat option
106 #endif // SNACC_DEEP_COPY
109 void AttributeCertificateAssertionSetOf::Print (ostream
&os
) const
112 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
113 indentG
+= stdIndentG
;
115 //for (; Curr() != NULL; GoNext())
116 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
118 Indent (os
, indentG
);
121 //if (Curr() != Last())
126 indentG
-= stdIndentG
;
127 Indent (os
, indentG
);
135 void AttributeCertificateAssertionSetOf::SetCurrElmt (unsigned long int index
)
140 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
142 } // AttributeCertificateAssertionSetOf::SetCurrElmt
145 unsigned long int AttributeCertificateAssertionSetOf::GetCurrElmtIndex()
151 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
160 } // AttributeCertificateAssertionSetOf::GetCurrElmtIndex
163 // alloc new list elmt, put at end of list
164 // and return the component type
165 AttributeType
*AttributeCertificateAssertionSetOf::Append()
167 AsnListElmt
*newElmt
;
168 newElmt
= new AsnListElmt
;
169 newElmt
->elmt
= new AttributeType
;
170 newElmt
->next
= NULL
;
173 newElmt
->prev
= NULL
;
174 first
= last
= newElmt
;
178 newElmt
->prev
= last
;
179 last
->next
= newElmt
;
183 return (curr
= newElmt
)->elmt
;
184 } // AttributeCertificateAssertionSetOf::Append
187 // alloc new list elmt, put at begining of list
188 // and return the component type
189 AttributeType
*AttributeCertificateAssertionSetOf::Prepend()
191 AsnListElmt
*newElmt
;
192 newElmt
= new AsnListElmt
;
193 newElmt
->elmt
= new AttributeType
;
194 newElmt
->prev
= NULL
;
197 newElmt
->next
= NULL
;
198 first
= last
= newElmt
;
202 newElmt
->next
= first
;
203 first
->prev
= newElmt
;
207 return (curr
= newElmt
)->elmt
;
208 } // AttributeCertificateAssertionSetOf::Prepend
211 // alloc new list elmt, insert it before the
212 // current element and return the component type
213 // if the current element is null, the new element
214 // is placed at the beginning of the list.
215 AttributeType
*AttributeCertificateAssertionSetOf::InsertBefore()
217 AsnListElmt
*newElmt
;
218 newElmt
= new AsnListElmt
;
219 newElmt
->elmt
= new AttributeType
;
222 newElmt
->next
= first
;
223 newElmt
->prev
= NULL
;
230 newElmt
->next
= curr
;
231 newElmt
->prev
= curr
->prev
;
232 curr
->prev
= newElmt
;
236 newElmt
->prev
->next
= newElmt
;
239 return (curr
= newElmt
)->elmt
;
240 } // AttributeCertificateAssertionSetOf::InsertBefore
243 // alloc new list elmt, insert it after the
244 // current element and return the component type
245 // if the current element is null, the new element
246 // is placed at the end of the list.
247 AttributeType
*AttributeCertificateAssertionSetOf::InsertAfter()
249 AsnListElmt
*newElmt
;
250 newElmt
= new AsnListElmt
;
251 newElmt
->elmt
= new AttributeType
;
254 newElmt
->prev
= last
;
255 newElmt
->next
= NULL
;
262 newElmt
->prev
= curr
;
263 newElmt
->next
= curr
->next
;
264 curr
->next
= newElmt
;
268 newElmt
->next
->prev
= newElmt
;
271 return (curr
= newElmt
)->elmt
;
272 } // AttributeCertificateAssertionSetOf::InsertAfter
275 AttributeCertificateAssertionSetOf
&AttributeCertificateAssertionSetOf::AppendCopy (AttributeType
&elmt
)
277 AsnListElmt
*newElmt
;
278 newElmt
= new AsnListElmt
;
279 newElmt
->elmt
= new AttributeType
;
280 *newElmt
->elmt
= elmt
;
281 newElmt
->next
= NULL
;
284 newElmt
->prev
= NULL
;
285 first
= last
= newElmt
;
289 newElmt
->prev
= last
;
290 last
->next
= newElmt
;
298 AttributeCertificateAssertionSetOf
&AttributeCertificateAssertionSetOf::PrependCopy (AttributeType
&elmt
)
300 AsnListElmt
*newElmt
;
301 newElmt
= new AsnListElmt
;
302 newElmt
->elmt
= new AttributeType
;
303 *newElmt
->elmt
= elmt
;
304 newElmt
->prev
= NULL
;
307 newElmt
->next
= NULL
;
308 first
= last
= newElmt
;
312 newElmt
->next
= first
;
313 first
->prev
= newElmt
;
318 } // AttributeCertificateAssertionSetOf::PrependCopy
321 // alloc new list elmt, insert it before the
322 // current element, copy the given elmt into the new elmt
323 // and return the component type.
324 // if the current element is null, the new element
325 // is placed at the beginning of the list.
326 AttributeCertificateAssertionSetOf
&AttributeCertificateAssertionSetOf::InsertBeforeAndCopy (AttributeType
&elmt
)
328 AsnListElmt
*newElmt
;
330 newElmt
= new AsnListElmt
;
331 newElmt
->elmt
= new AttributeType
;
332 *newElmt
->elmt
= elmt
;
336 newElmt
->next
= first
;
337 newElmt
->prev
= NULL
;
344 newElmt
->next
= curr
;
345 newElmt
->prev
= curr
->prev
;
346 curr
->prev
= newElmt
;
350 newElmt
->prev
->next
= newElmt
;
354 } // AttributeCertificateAssertionSetOf::InsertBeforeAndCopy
357 // alloc new list elmt, insert it after the
358 // current element, copy given elmt in to new elmt
359 // and return the component type
360 // if the current element is null, the new element
361 // is placed at the end of the list.
362 AttributeCertificateAssertionSetOf
&AttributeCertificateAssertionSetOf::InsertAfterAndCopy (AttributeType
&elmt
)
364 AsnListElmt
*newElmt
;
366 newElmt
= new AsnListElmt
;
367 newElmt
->elmt
= new AttributeType
;
368 *newElmt
->elmt
= elmt
;
371 newElmt
->prev
= last
;
372 newElmt
->next
= NULL
;
379 newElmt
->prev
= curr
;
380 newElmt
->next
= curr
->next
;
381 curr
->next
= newElmt
;
385 newElmt
->next
->prev
= newElmt
;
389 } // AttributeCertificateAssertionSetOf::InsertAfterAndCopy
392 // remove current element from list if current element is not NULL
393 // The new current element will be the next element.
394 // If the current element is the last element in the list
395 // the second but last element will become the new current element.
396 void AttributeCertificateAssertionSetOf::RemoveCurrFromList()
398 AsnListElmt
*del_elmt
;
406 first
= last
= curr
= NULL
;
407 else if (curr
== first
)
409 curr
= first
= first
->next
;
412 else if (curr
== last
)
414 curr
= last
= last
->prev
;
419 curr
->prev
->next
= curr
->next
;
420 curr
->next
->prev
= curr
->prev
;
423 delete del_elmt
->elmt
;
429 AsnLen
AttributeCertificateAssertionSetOf::BEncContent (BUF_TYPE b
)
431 AsnListElmt
*currElmt
;
436 CSM_Buffer
**tmpEnc
=NULL
;
437 for (currElmt
= last
,icount
=0; currElmt
!= NULL
; currElmt
= currElmt
->prev
, icount
++);
438 tmpEnc
= (CSM_Buffer
**) calloc(sizeof(CSM_Buffer
*), icount
);
439 for (currElmt
= last
, iii
=0; currElmt
!= NULL
; currElmt
= currElmt
->prev
,iii
++,elmtLen
=0)
441 ENCODE_BUF1(currElmt
->elmt
->BEncContent
, elmtLen
);
442 elmtLen
+= BEncDefLen (outputBuf
, elmtLen
);
444 elmtLen
+= BEncTag1 (outputBuf
, UNIV
, PRIM
, OID_TAG_CODE
);
445 ENCODE_BUF2(tmpEnc
[iii
]);
447 vdasnacc_sortSetOf(tmpEnc
, icount
);
448 for (iii
=0,elmtLen
=0; iii
< icount
; elmtLen
+=tmpEnc
[iii
++]->Length())
449 SM_WriteToAsnBuf(tmpEnc
[iii
], b
);
450 for (iii
=0; iii
< icount
; iii
++) delete tmpEnc
[iii
];
455 } // AttributeCertificateAssertionSetOf::BEncContent
458 void AttributeCertificateAssertionSetOf::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
459 AsnLen
&bytesDecoded
, ENV_TYPE env
)
461 AttributeType
*listElmt
;
463 AsnLen listBytesDecoded
= 0;
466 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
468 tag1
= BDecTag (b
, listBytesDecoded
, env
);
469 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
471 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
474 if ((tag1
!= MAKE_TAG_ID (UNIV
, PRIM
, OID_TAG_CODE
)))
476 Asn1Error
<< "Unexpected Tag" << endl
;
480 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
482 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
485 bytesDecoded
+= listBytesDecoded
;
486 } // AttributeCertificateAssertionSetOf::BDecContent
489 AsnType
*AttributeCertificateInfoSeqOf::Clone() const
491 return new AttributeCertificateInfoSeqOf
;
494 AsnType
*AttributeCertificateInfoSeqOf::Copy() const
496 return new AttributeCertificateInfoSeqOf (*this);
499 AsnLen
AttributeCertificateInfoSeqOf::BEnc (BUF_TYPE b
)
503 l
+= BEncConsLen (b
, l
);
504 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
508 void AttributeCertificateInfoSeqOf::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
513 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
515 Asn1Error
<< "AttributeCertificateInfoSeqOf::BDec: ERROR - wrong tag" << endl
;
518 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
519 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
522 AttributeCertificateInfoSeqOf::AttributeCertificateInfoSeqOf (const AttributeCertificateInfoSeqOf
&)
524 Asn1Error
<< "use of incompletely defined AttributeCertificateInfoSeqOf::AttributeCertificateInfoSeqOf (const AttributeCertificateInfoSeqOf &)" << endl
;
528 AttributeCertificateInfoSeqOf::~AttributeCertificateInfoSeqOf()
531 for (; Curr() != NULL
; RemoveCurrFromList())
533 } // end of destructor
536 AttributeCertificateInfoSeqOf
&AttributeCertificateInfoSeqOf::operator = (const AttributeCertificateInfoSeqOf
&that
)
537 #else // SNACC_DEEP_COPY
538 AttributeCertificateInfoSeqOf
&AttributeCertificateInfoSeqOf::operator = (const AttributeCertificateInfoSeqOf
&)
539 #endif // SNACC_DEEP_COPY
545 for (; Curr(); RemoveCurrFromList())
548 //that.SetCurrToFirst();
549 //for (; that.Curr(); that.GoNext())
550 // AppendCopy (*that.Curr());
551 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
552 AppendCopy (*run
->elmt
);
556 #else // SNACC_DEEP_COPY
557 Asn1Error
<< "use of incompletely defined AttributeCertificateInfoSeqOf &AttributeCertificateInfoSeqOf::operator = (const AttributeCertificateInfoSeqOf &)" << endl
;
559 // if your compiler complains here, check the -novolat option
560 #endif // SNACC_DEEP_COPY
563 void AttributeCertificateInfoSeqOf::Print (ostream
&os
) const
566 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
567 indentG
+= stdIndentG
;
569 //for (; Curr() != NULL; GoNext())
570 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
572 Indent (os
, indentG
);
575 //if (Curr() != Last())
580 indentG
-= stdIndentG
;
581 Indent (os
, indentG
);
589 void AttributeCertificateInfoSeqOf::SetCurrElmt (unsigned long int index
)
594 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
596 } // AttributeCertificateInfoSeqOf::SetCurrElmt
599 unsigned long int AttributeCertificateInfoSeqOf::GetCurrElmtIndex()
605 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
614 } // AttributeCertificateInfoSeqOf::GetCurrElmtIndex
617 // alloc new list elmt, put at end of list
618 // and return the component type
619 Attribute
*AttributeCertificateInfoSeqOf::Append()
621 AsnListElmt
*newElmt
;
622 newElmt
= new AsnListElmt
;
623 newElmt
->elmt
= new Attribute
;
624 newElmt
->next
= NULL
;
627 newElmt
->prev
= NULL
;
628 first
= last
= newElmt
;
632 newElmt
->prev
= last
;
633 last
->next
= newElmt
;
637 return (curr
= newElmt
)->elmt
;
638 } // AttributeCertificateInfoSeqOf::Append
641 // alloc new list elmt, put at begining of list
642 // and return the component type
643 Attribute
*AttributeCertificateInfoSeqOf::Prepend()
645 AsnListElmt
*newElmt
;
646 newElmt
= new AsnListElmt
;
647 newElmt
->elmt
= new Attribute
;
648 newElmt
->prev
= NULL
;
651 newElmt
->next
= NULL
;
652 first
= last
= newElmt
;
656 newElmt
->next
= first
;
657 first
->prev
= newElmt
;
661 return (curr
= newElmt
)->elmt
;
662 } // AttributeCertificateInfoSeqOf::Prepend
665 // alloc new list elmt, insert it before the
666 // current element and return the component type
667 // if the current element is null, the new element
668 // is placed at the beginning of the list.
669 Attribute
*AttributeCertificateInfoSeqOf::InsertBefore()
671 AsnListElmt
*newElmt
;
672 newElmt
= new AsnListElmt
;
673 newElmt
->elmt
= new Attribute
;
676 newElmt
->next
= first
;
677 newElmt
->prev
= NULL
;
684 newElmt
->next
= curr
;
685 newElmt
->prev
= curr
->prev
;
686 curr
->prev
= newElmt
;
690 newElmt
->prev
->next
= newElmt
;
693 return (curr
= newElmt
)->elmt
;
694 } // AttributeCertificateInfoSeqOf::InsertBefore
697 // alloc new list elmt, insert it after the
698 // current element and return the component type
699 // if the current element is null, the new element
700 // is placed at the end of the list.
701 Attribute
*AttributeCertificateInfoSeqOf::InsertAfter()
703 AsnListElmt
*newElmt
;
704 newElmt
= new AsnListElmt
;
705 newElmt
->elmt
= new Attribute
;
708 newElmt
->prev
= last
;
709 newElmt
->next
= NULL
;
716 newElmt
->prev
= curr
;
717 newElmt
->next
= curr
->next
;
718 curr
->next
= newElmt
;
722 newElmt
->next
->prev
= newElmt
;
725 return (curr
= newElmt
)->elmt
;
726 } // AttributeCertificateInfoSeqOf::InsertAfter
729 AttributeCertificateInfoSeqOf
&AttributeCertificateInfoSeqOf::AppendCopy (Attribute
&elmt
)
731 AsnListElmt
*newElmt
;
732 newElmt
= new AsnListElmt
;
733 newElmt
->elmt
= new Attribute
;
734 *newElmt
->elmt
= elmt
;
735 newElmt
->next
= NULL
;
738 newElmt
->prev
= NULL
;
739 first
= last
= newElmt
;
743 newElmt
->prev
= last
;
744 last
->next
= newElmt
;
752 AttributeCertificateInfoSeqOf
&AttributeCertificateInfoSeqOf::PrependCopy (Attribute
&elmt
)
754 AsnListElmt
*newElmt
;
755 newElmt
= new AsnListElmt
;
756 newElmt
->elmt
= new Attribute
;
757 *newElmt
->elmt
= elmt
;
758 newElmt
->prev
= NULL
;
761 newElmt
->next
= NULL
;
762 first
= last
= newElmt
;
766 newElmt
->next
= first
;
767 first
->prev
= newElmt
;
772 } // AttributeCertificateInfoSeqOf::PrependCopy
775 // alloc new list elmt, insert it before the
776 // current element, copy the given elmt into the new elmt
777 // and return the component type.
778 // if the current element is null, the new element
779 // is placed at the beginning of the list.
780 AttributeCertificateInfoSeqOf
&AttributeCertificateInfoSeqOf::InsertBeforeAndCopy (Attribute
&elmt
)
782 AsnListElmt
*newElmt
;
784 newElmt
= new AsnListElmt
;
785 newElmt
->elmt
= new Attribute
;
786 *newElmt
->elmt
= elmt
;
790 newElmt
->next
= first
;
791 newElmt
->prev
= NULL
;
798 newElmt
->next
= curr
;
799 newElmt
->prev
= curr
->prev
;
800 curr
->prev
= newElmt
;
804 newElmt
->prev
->next
= newElmt
;
808 } // AttributeCertificateInfoSeqOf::InsertBeforeAndCopy
811 // alloc new list elmt, insert it after the
812 // current element, copy given elmt in to new elmt
813 // and return the component type
814 // if the current element is null, the new element
815 // is placed at the end of the list.
816 AttributeCertificateInfoSeqOf
&AttributeCertificateInfoSeqOf::InsertAfterAndCopy (Attribute
&elmt
)
818 AsnListElmt
*newElmt
;
820 newElmt
= new AsnListElmt
;
821 newElmt
->elmt
= new Attribute
;
822 *newElmt
->elmt
= elmt
;
825 newElmt
->prev
= last
;
826 newElmt
->next
= NULL
;
833 newElmt
->prev
= curr
;
834 newElmt
->next
= curr
->next
;
835 curr
->next
= newElmt
;
839 newElmt
->next
->prev
= newElmt
;
843 } // AttributeCertificateInfoSeqOf::InsertAfterAndCopy
846 // remove current element from list if current element is not NULL
847 // The new current element will be the next element.
848 // If the current element is the last element in the list
849 // the second but last element will become the new current element.
850 void AttributeCertificateInfoSeqOf::RemoveCurrFromList()
852 AsnListElmt
*del_elmt
;
860 first
= last
= curr
= NULL
;
861 else if (curr
== first
)
863 curr
= first
= first
->next
;
866 else if (curr
== last
)
868 curr
= last
= last
->prev
;
873 curr
->prev
->next
= curr
->next
;
874 curr
->next
->prev
= curr
->prev
;
877 delete del_elmt
->elmt
;
883 AsnLen
AttributeCertificateInfoSeqOf::BEncContent (BUF_TYPE b
)
885 AsnListElmt
*currElmt
;
888 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
891 elmtLen
= currElmt
->elmt
->BEncContent (b
);
892 elmtLen
+= BEncConsLen (b
, elmtLen
);
894 elmtLen
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
898 } // AttributeCertificateInfoSeqOf::BEncContent
901 void AttributeCertificateInfoSeqOf::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
902 AsnLen
&bytesDecoded
, ENV_TYPE env
)
906 AsnLen listBytesDecoded
= 0;
909 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
911 tag1
= BDecTag (b
, listBytesDecoded
, env
);
912 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
914 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
917 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
919 Asn1Error
<< "Unexpected Tag" << endl
;
923 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
925 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
928 bytesDecoded
+= listBytesDecoded
;
929 } // AttributeCertificateInfoSeqOf::BDecContent
932 AlgorithmIdentifier::AlgorithmIdentifier()
937 AlgorithmIdentifier::AlgorithmIdentifier (const AlgorithmIdentifier
&)
939 Asn1Error
<< "use of incompletely defined AlgorithmIdentifier::AlgorithmIdentifier (const AlgorithmIdentifier &)" << endl
;
943 AlgorithmIdentifier::~AlgorithmIdentifier()
948 AsnType
*AlgorithmIdentifier::Clone() const
950 return new AlgorithmIdentifier
;
953 AsnType
*AlgorithmIdentifier::Copy() const
955 return new AlgorithmIdentifier (*this);
959 AlgorithmIdentifier
&AlgorithmIdentifier::operator = (const AlgorithmIdentifier
&that
)
960 #else // SNACC_DEEP_COPY
961 AlgorithmIdentifier
&AlgorithmIdentifier::operator = (const AlgorithmIdentifier
&)
962 #endif // SNACC_DEEP_COPY
967 algorithm
= that
.algorithm
;
971 parameters
= new AsnAny
;
972 *parameters
= *that
.parameters
;
982 #else // SNACC_DEEP_COPY
983 Asn1Error
<< "use of incompletely defined AlgorithmIdentifier &AlgorithmIdentifier::operator = (const AlgorithmIdentifier &)" << endl
;
985 // if your compiler complains here, check the -novolat option
986 #endif // SNACC_DEEP_COPY
990 AlgorithmIdentifier::BEncContent (BUF_TYPE b
)
995 if (NOT_NULL (parameters
))
997 ENC_LOAD_ANYBUF(parameters
, b
, l
);
1001 l
= algorithm
.BEncContent (b
);
1002 l
+= BEncDefLen (b
, l
);
1004 l
+= BEncTag1 (b
, UNIV
, PRIM
, OID_TAG_CODE
);
1008 } // AlgorithmIdentifier::BEncContent
1011 void AlgorithmIdentifier::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1014 AsnLen seqBytesDecoded
= 0;
1016 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1018 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, OID_TAG_CODE
)))
1020 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1021 algorithm
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1022 if (seqBytesDecoded
== elmtLen0
)
1024 bytesDecoded
+= seqBytesDecoded
;
1029 tag1
= b
.PeekByte();
1031 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
1033 BDecEoc (b
, seqBytesDecoded
, env
);
1035 bytesDecoded
+= seqBytesDecoded
;
1042 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1043 longjmp (env
, -104);
1047 parameters
= new AsnAny
;
1048 DEC_LOAD_ANYBUF(parameters
, b
, seqBytesDecoded
, env
);
1051 bytesDecoded
+= seqBytesDecoded
;
1052 if (elmtLen0
== INDEFINITE_LEN
)
1054 BDecEoc (b
, bytesDecoded
, env
);
1057 else if (seqBytesDecoded
!= elmtLen0
)
1059 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
1060 longjmp (env
, -105);
1064 } // AlgorithmIdentifier::BDecContent
1066 AsnLen
AlgorithmIdentifier::BEnc (BUF_TYPE b
)
1069 l
= BEncContent (b
);
1070 l
+= BEncConsLen (b
, l
);
1071 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
1075 void AlgorithmIdentifier::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1080 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
1082 Asn1Error
<< "AlgorithmIdentifier::BDec: ERROR - wrong tag" << endl
;
1083 longjmp (env
, -106);
1085 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
1086 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
1089 int AlgorithmIdentifier::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
1091 bytesEncoded
= BEnc (b
);
1092 return !b
.WriteError();
1095 int AlgorithmIdentifier::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
1101 if ((val
= setjmp (env
)) == 0)
1103 BDec (b
, bytesDecoded
, env
);
1104 return !b
.ReadError();
1110 void AlgorithmIdentifier::Print (ostream
&os
) const
1113 os
<< "{ -- SEQUENCE --" << endl
;
1114 indentG
+= stdIndentG
;
1117 Indent (os
, indentG
);
1123 if (NOT_NULL (parameters
))
1126 Indent (os
, indentG
);
1127 os
<< "parameters ";
1132 Indent (os
, indentG
);
1133 os
<< "parameters ";
1139 indentG
-= stdIndentG
;
1140 Indent (os
, indentG
);
1143 } // AlgorithmIdentifier::Print
1148 choiceId
= utcTimeCid
;
1150 utcTime
= new UTCTime
;
1152 utcTime
= NULL
; // incomplete initialization of mandatory element!
1156 Time::Time (const Time
&)
1158 Asn1Error
<< "use of incompletely defined Time::Time (const Time &)" << endl
;
1169 case generalizedTimeCid
:
1170 delete generalizedTime
;
1173 } // end of destructor
1175 AsnType
*Time::Clone() const
1180 AsnType
*Time::Copy() const
1182 return new Time (*this);
1186 Time
&Time::operator = (const Time
&that
)
1187 #else // SNACC_DEEP_COPY
1188 Time
&Time::operator = (const Time
&)
1189 #endif // SNACC_DEEP_COPY
1199 case generalizedTimeCid
:
1200 delete generalizedTime
;
1203 switch (choiceId
= that
.choiceId
)
1206 utcTime
= new UTCTime
;
1207 *utcTime
= *that
.utcTime
;
1209 case generalizedTimeCid
:
1210 generalizedTime
= new GeneralizedTime
;
1211 *generalizedTime
= *that
.generalizedTime
;
1217 #else // SNACC_DEEP_COPY
1218 Asn1Error
<< "use of incompletely defined Time &Time::operator = (const Time &)" << endl
;
1220 // if your compiler complains here, check the -novolat option
1221 #endif // SNACC_DEEP_COPY
1225 Time::BEncContent (BUF_TYPE b
)
1231 l
= utcTime
->BEncContent (b
);
1232 l
+= BEncDefLen (b
, l
);
1234 l
+= BEncTag1 (b
, UNIV
, PRIM
, UTCTIME_TAG_CODE
);
1237 case generalizedTimeCid
:
1238 l
= generalizedTime
->BEncContent (b
);
1239 l
+= BEncDefLen (b
, l
);
1241 l
+= BEncTag1 (b
, UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
);
1246 } // Time::BEncContent
1249 void Time::BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1253 case MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
):
1254 case MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
):
1255 choiceId
= utcTimeCid
;
1256 utcTime
= new UTCTime
;
1257 utcTime
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
1260 case MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
):
1261 case MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
):
1262 choiceId
= generalizedTimeCid
;
1263 generalizedTime
= new GeneralizedTime
;
1264 generalizedTime
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
1268 Asn1Error
<< "ERROR - unexpected tag in CHOICE" << endl
;
1269 longjmp (env
, -107);
1272 } // Time::BDecContent
1275 AsnLen
Time::BEnc (BUF_TYPE b
)
1278 l
= BEncContent (b
);
1282 void Time::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1287 /* CHOICEs are a special case - grab identifying tag */
1288 /* this allows easier handling of nested CHOICEs */
1289 tag
= BDecTag (b
, bytesDecoded
, env
);
1290 elmtLen
= BDecLen (b
, bytesDecoded
, env
);
1291 BDecContent (b
, tag
, elmtLen
, bytesDecoded
, env
);
1294 int Time::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
1296 bytesEncoded
= BEnc (b
);
1297 return !b
.WriteError();
1300 int Time::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
1306 if ((val
= setjmp (env
)) == 0)
1308 BDec (b
, bytesDecoded
, env
);
1309 return !b
.ReadError();
1315 void Time::Print (ostream
&os
) const
1325 os
<< "-- void3 --\n";
1328 case generalizedTimeCid
:
1329 os
<< "generalizedTime ";
1330 if (generalizedTime
)
1331 os
<< *generalizedTime
;
1333 os
<< "-- void3 --\n";
1340 Extension::Extension()
1345 Extension::Extension (const Extension
&)
1347 Asn1Error
<< "use of incompletely defined Extension::Extension (const Extension &)" << endl
;
1351 Extension::~Extension()
1356 AsnType
*Extension::Clone() const
1358 return new Extension
;
1361 AsnType
*Extension::Copy() const
1363 return new Extension (*this);
1367 Extension
&Extension::operator = (const Extension
&that
)
1368 #else // SNACC_DEEP_COPY
1369 Extension
&Extension::operator = (const Extension
&)
1370 #endif // SNACC_DEEP_COPY
1375 extnId
= that
.extnId
;
1379 critical
= new AsnBool
;
1380 *critical
= *that
.critical
;
1387 extnValue
= that
.extnValue
;
1391 #else // SNACC_DEEP_COPY
1392 Asn1Error
<< "use of incompletely defined Extension &Extension::operator = (const Extension &)" << endl
;
1394 // if your compiler complains here, check the -novolat option
1395 #endif // SNACC_DEEP_COPY
1399 Extension::BEncContent (BUF_TYPE b
)
1401 AsnLen totalLen
= 0;
1404 l
= extnValue
.BEncContent (b
);
1405 l
+= BEncDefLen (b
, l
);
1407 l
+= BEncTag1 (b
, UNIV
, PRIM
, OCTETSTRING_TAG_CODE
);
1410 if (NOT_NULL (critical
))
1412 l
= critical
->BEncContent (b
);
1413 BEncDefLenTo127 (b
, l
);
1416 l
+= BEncTag1 (b
, UNIV
, PRIM
, BOOLEAN_TAG_CODE
);
1420 l
= extnId
.BEncContent (b
);
1421 l
+= BEncDefLen (b
, l
);
1423 l
+= BEncTag1 (b
, UNIV
, PRIM
, OID_TAG_CODE
);
1427 } // Extension::BEncContent
1430 void Extension::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1433 AsnLen seqBytesDecoded
= 0;
1435 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1437 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, OID_TAG_CODE
)))
1439 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1440 extnId
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1441 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1445 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1446 longjmp (env
, -108);
1449 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BOOLEAN_TAG_CODE
)))
1451 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1452 critical
= new AsnBool
;
1453 critical
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1454 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1457 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, OCTETSTRING_TAG_CODE
))
1458 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, OCTETSTRING_TAG_CODE
)))
1460 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1461 extnValue
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1465 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1466 longjmp (env
, -109);
1469 bytesDecoded
+= seqBytesDecoded
;
1470 if (elmtLen0
== INDEFINITE_LEN
)
1472 BDecEoc (b
, bytesDecoded
, env
);
1475 else if (seqBytesDecoded
!= elmtLen0
)
1477 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
1478 longjmp (env
, -110);
1482 } // Extension::BDecContent
1484 AsnLen
Extension::BEnc (BUF_TYPE b
)
1487 l
= BEncContent (b
);
1488 l
+= BEncConsLen (b
, l
);
1489 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
1493 void Extension::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1498 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
1500 Asn1Error
<< "Extension::BDec: ERROR - wrong tag" << endl
;
1501 longjmp (env
, -111);
1503 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
1504 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
1507 int Extension::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
1509 bytesEncoded
= BEnc (b
);
1510 return !b
.WriteError();
1513 int Extension::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
1519 if ((val
= setjmp (env
)) == 0)
1521 BDec (b
, bytesDecoded
, env
);
1522 return !b
.ReadError();
1528 void Extension::Print (ostream
&os
) const
1531 os
<< "{ -- SEQUENCE --" << endl
;
1532 indentG
+= stdIndentG
;
1535 Indent (os
, indentG
);
1541 if (NOT_NULL (critical
))
1543 Indent (os
, indentG
);
1549 Indent (os
, indentG
);
1556 Indent (os
, indentG
);
1562 indentG
-= stdIndentG
;
1563 Indent (os
, indentG
);
1566 } // Extension::Print
1569 AttCertValidityPeriod::AttCertValidityPeriod()
1573 AttCertValidityPeriod::AttCertValidityPeriod (const AttCertValidityPeriod
&)
1575 Asn1Error
<< "use of incompletely defined AttCertValidityPeriod::AttCertValidityPeriod (const AttCertValidityPeriod &)" << endl
;
1579 AttCertValidityPeriod::~AttCertValidityPeriod()
1583 AsnType
*AttCertValidityPeriod::Clone() const
1585 return new AttCertValidityPeriod
;
1588 AsnType
*AttCertValidityPeriod::Copy() const
1590 return new AttCertValidityPeriod (*this);
1594 AttCertValidityPeriod
&AttCertValidityPeriod::operator = (const AttCertValidityPeriod
&that
)
1595 #else // SNACC_DEEP_COPY
1596 AttCertValidityPeriod
&AttCertValidityPeriod::operator = (const AttCertValidityPeriod
&)
1597 #endif // SNACC_DEEP_COPY
1602 notBeforeTime
= that
.notBeforeTime
;
1603 notAfterTime
= that
.notAfterTime
;
1607 #else // SNACC_DEEP_COPY
1608 Asn1Error
<< "use of incompletely defined AttCertValidityPeriod &AttCertValidityPeriod::operator = (const AttCertValidityPeriod &)" << endl
;
1610 // if your compiler complains here, check the -novolat option
1611 #endif // SNACC_DEEP_COPY
1615 AttCertValidityPeriod::BEncContent (BUF_TYPE b
)
1617 AsnLen totalLen
= 0;
1620 l
= notAfterTime
.BEncContent (b
);
1621 l
+= BEncDefLen (b
, l
);
1623 l
+= BEncTag1 (b
, UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
);
1626 l
= notBeforeTime
.BEncContent (b
);
1627 l
+= BEncDefLen (b
, l
);
1629 l
+= BEncTag1 (b
, UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
);
1633 } // AttCertValidityPeriod::BEncContent
1636 void AttCertValidityPeriod::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1639 AsnLen seqBytesDecoded
= 0;
1641 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1643 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
1644 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
1646 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1647 notBeforeTime
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1648 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1652 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1653 longjmp (env
, -112);
1656 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
1657 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
1659 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1660 notAfterTime
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1664 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1665 longjmp (env
, -113);
1668 bytesDecoded
+= seqBytesDecoded
;
1669 if (elmtLen0
== INDEFINITE_LEN
)
1671 BDecEoc (b
, bytesDecoded
, env
);
1674 else if (seqBytesDecoded
!= elmtLen0
)
1676 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
1677 longjmp (env
, -114);
1681 } // AttCertValidityPeriod::BDecContent
1683 AsnLen
AttCertValidityPeriod::BEnc (BUF_TYPE b
)
1686 l
= BEncContent (b
);
1687 l
+= BEncConsLen (b
, l
);
1688 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
1692 void AttCertValidityPeriod::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1697 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
1699 Asn1Error
<< "AttCertValidityPeriod::BDec: ERROR - wrong tag" << endl
;
1700 longjmp (env
, -115);
1702 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
1703 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
1706 int AttCertValidityPeriod::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
1708 bytesEncoded
= BEnc (b
);
1709 return !b
.WriteError();
1712 int AttCertValidityPeriod::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
1718 if ((val
= setjmp (env
)) == 0)
1720 BDec (b
, bytesDecoded
, env
);
1721 return !b
.ReadError();
1727 void AttCertValidityPeriod::Print (ostream
&os
) const
1730 os
<< "{ -- SEQUENCE --" << endl
;
1731 indentG
+= stdIndentG
;
1734 Indent (os
, indentG
);
1735 os
<< "notBeforeTime ";
1736 os
<< notBeforeTime
;
1741 Indent (os
, indentG
);
1742 os
<< "notAfterTime ";
1747 indentG
-= stdIndentG
;
1748 Indent (os
, indentG
);
1751 } // AttCertValidityPeriod::Print
1754 Validity::Validity()
1757 notBefore
= new Time
;
1759 notBefore
= NULL
; // incomplete initialization of mandatory element!
1762 notAfter
= new Time
;
1764 notAfter
= NULL
; // incomplete initialization of mandatory element!
1768 Validity::Validity (const Validity
&)
1770 Asn1Error
<< "use of incompletely defined Validity::Validity (const Validity &)" << endl
;
1774 Validity::~Validity()
1780 AsnType
*Validity::Clone() const
1782 return new Validity
;
1785 AsnType
*Validity::Copy() const
1787 return new Validity (*this);
1791 Validity
&Validity::operator = (const Validity
&that
)
1792 #else // SNACC_DEEP_COPY
1793 Validity
&Validity::operator = (const Validity
&)
1794 #endif // SNACC_DEEP_COPY
1802 notBefore
= new Time
;
1803 *notBefore
= *that
.notBefore
;
1813 notAfter
= new Time
;
1814 *notAfter
= *that
.notAfter
;
1824 #else // SNACC_DEEP_COPY
1825 Asn1Error
<< "use of incompletely defined Validity &Validity::operator = (const Validity &)" << endl
;
1827 // if your compiler complains here, check the -novolat option
1828 #endif // SNACC_DEEP_COPY
1832 Validity::BEncContent (BUF_TYPE b
)
1834 AsnLen totalLen
= 0;
1837 l
= notAfter
->BEncContent (b
);
1840 l
= notBefore
->BEncContent (b
);
1844 } // Validity::BEncContent
1847 void Validity::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1850 AsnLen seqBytesDecoded
= 0;
1852 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1854 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
))
1855 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
))
1856 || (tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
1857 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
1859 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1860 notBefore
= new Time
;
1861 notBefore
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1862 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
1866 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1867 longjmp (env
, -116);
1870 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
))
1871 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
))
1872 || (tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
1873 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
1875 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
1876 notAfter
= new Time
;
1877 notAfter
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
1881 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
1882 longjmp (env
, -117);
1885 bytesDecoded
+= seqBytesDecoded
;
1886 if (elmtLen0
== INDEFINITE_LEN
)
1888 BDecEoc (b
, bytesDecoded
, env
);
1891 else if (seqBytesDecoded
!= elmtLen0
)
1893 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
1894 longjmp (env
, -118);
1898 } // Validity::BDecContent
1900 AsnLen
Validity::BEnc (BUF_TYPE b
)
1903 l
= BEncContent (b
);
1904 l
+= BEncConsLen (b
, l
);
1905 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
1909 void Validity::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
1914 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
1916 Asn1Error
<< "Validity::BDec: ERROR - wrong tag" << endl
;
1917 longjmp (env
, -119);
1919 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
1920 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
1923 int Validity::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
1925 bytesEncoded
= BEnc (b
);
1926 return !b
.WriteError();
1929 int Validity::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
1935 if ((val
= setjmp (env
)) == 0)
1937 BDec (b
, bytesDecoded
, env
);
1938 return !b
.ReadError();
1944 void Validity::Print (ostream
&os
) const
1947 os
<< "{ -- SEQUENCE --" << endl
;
1948 indentG
+= stdIndentG
;
1950 if (NOT_NULL (notBefore
))
1952 Indent (os
, indentG
);
1958 Indent (os
, indentG
);
1964 if (NOT_NULL (notAfter
))
1966 Indent (os
, indentG
);
1972 Indent (os
, indentG
);
1979 indentG
-= stdIndentG
;
1980 Indent (os
, indentG
);
1983 } // Validity::Print
1986 SubjectPublicKeyInfo::SubjectPublicKeyInfo()
1989 algorithm
= new AlgorithmIdentifier
;
1991 algorithm
= NULL
; // incomplete initialization of mandatory element!
1995 SubjectPublicKeyInfo::SubjectPublicKeyInfo (const SubjectPublicKeyInfo
&)
1997 Asn1Error
<< "use of incompletely defined SubjectPublicKeyInfo::SubjectPublicKeyInfo (const SubjectPublicKeyInfo &)" << endl
;
2001 SubjectPublicKeyInfo::~SubjectPublicKeyInfo()
2006 AsnType
*SubjectPublicKeyInfo::Clone() const
2008 return new SubjectPublicKeyInfo
;
2011 AsnType
*SubjectPublicKeyInfo::Copy() const
2013 return new SubjectPublicKeyInfo (*this);
2017 SubjectPublicKeyInfo
&SubjectPublicKeyInfo::operator = (const SubjectPublicKeyInfo
&that
)
2018 #else // SNACC_DEEP_COPY
2019 SubjectPublicKeyInfo
&SubjectPublicKeyInfo::operator = (const SubjectPublicKeyInfo
&)
2020 #endif // SNACC_DEEP_COPY
2028 algorithm
= new AlgorithmIdentifier
;
2029 *algorithm
= *that
.algorithm
;
2036 subjectPublicKey
= that
.subjectPublicKey
;
2040 #else // SNACC_DEEP_COPY
2041 Asn1Error
<< "use of incompletely defined SubjectPublicKeyInfo &SubjectPublicKeyInfo::operator = (const SubjectPublicKeyInfo &)" << endl
;
2043 // if your compiler complains here, check the -novolat option
2044 #endif // SNACC_DEEP_COPY
2048 SubjectPublicKeyInfo::BEncContent (BUF_TYPE b
)
2050 AsnLen totalLen
= 0;
2053 l
= subjectPublicKey
.BEncContent (b
);
2054 l
+= BEncDefLen (b
, l
);
2056 l
+= BEncTag1 (b
, UNIV
, PRIM
, BITSTRING_TAG_CODE
);
2060 l
= algorithm
->BEncContent (b
);
2061 l
+= BEncConsLen (b
, l
);
2063 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2067 } // SubjectPublicKeyInfo::BEncContent
2070 void SubjectPublicKeyInfo::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
2073 AsnLen seqBytesDecoded
= 0;
2075 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
2077 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
2079 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
2080 algorithm
= new AlgorithmIdentifier
;
2081 algorithm
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
2082 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
2086 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
2087 longjmp (env
, -120);
2090 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BITSTRING_TAG_CODE
))
2091 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, BITSTRING_TAG_CODE
)))
2093 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
2094 subjectPublicKey
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
2098 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
2099 longjmp (env
, -121);
2102 bytesDecoded
+= seqBytesDecoded
;
2103 if (elmtLen0
== INDEFINITE_LEN
)
2105 BDecEoc (b
, bytesDecoded
, env
);
2108 else if (seqBytesDecoded
!= elmtLen0
)
2110 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
2111 longjmp (env
, -122);
2115 } // SubjectPublicKeyInfo::BDecContent
2117 AsnLen
SubjectPublicKeyInfo::BEnc (BUF_TYPE b
)
2120 l
= BEncContent (b
);
2121 l
+= BEncConsLen (b
, l
);
2122 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2126 void SubjectPublicKeyInfo::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
2131 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
2133 Asn1Error
<< "SubjectPublicKeyInfo::BDec: ERROR - wrong tag" << endl
;
2134 longjmp (env
, -123);
2136 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
2137 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
2140 int SubjectPublicKeyInfo::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
2142 bytesEncoded
= BEnc (b
);
2143 return !b
.WriteError();
2146 int SubjectPublicKeyInfo::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
2152 if ((val
= setjmp (env
)) == 0)
2154 BDec (b
, bytesDecoded
, env
);
2155 return !b
.ReadError();
2161 void SubjectPublicKeyInfo::Print (ostream
&os
) const
2164 os
<< "{ -- SEQUENCE --" << endl
;
2165 indentG
+= stdIndentG
;
2167 if (NOT_NULL (algorithm
))
2169 Indent (os
, indentG
);
2175 Indent (os
, indentG
);
2182 Indent (os
, indentG
);
2183 os
<< "subjectPublicKey ";
2184 os
<< subjectPublicKey
;
2188 indentG
-= stdIndentG
;
2189 Indent (os
, indentG
);
2192 } // SubjectPublicKeyInfo::Print
2195 AsnType
*Extensions::Clone() const
2197 return new Extensions
;
2200 AsnType
*Extensions::Copy() const
2202 return new Extensions (*this);
2205 AsnLen
Extensions::BEnc (BUF_TYPE b
)
2208 l
= BEncContent (b
);
2209 l
+= BEncConsLen (b
, l
);
2210 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2214 void Extensions::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
2219 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
2221 Asn1Error
<< "Extensions::BDec: ERROR - wrong tag" << endl
;
2222 longjmp (env
, -124);
2224 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
2225 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
2228 Extensions::Extensions (const Extensions
&)
2230 Asn1Error
<< "use of incompletely defined Extensions::Extensions (const Extensions &)" << endl
;
2234 Extensions::~Extensions()
2237 for (; Curr() != NULL
; RemoveCurrFromList())
2239 } // end of destructor
2242 Extensions
&Extensions::operator = (const Extensions
&that
)
2243 #else // SNACC_DEEP_COPY
2244 Extensions
&Extensions::operator = (const Extensions
&)
2245 #endif // SNACC_DEEP_COPY
2251 for (; Curr(); RemoveCurrFromList())
2254 //that.SetCurrToFirst();
2255 //for (; that.Curr(); that.GoNext())
2256 // AppendCopy (*that.Curr());
2257 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
2258 AppendCopy (*run
->elmt
);
2262 #else // SNACC_DEEP_COPY
2263 Asn1Error
<< "use of incompletely defined Extensions &Extensions::operator = (const Extensions &)" << endl
;
2265 // if your compiler complains here, check the -novolat option
2266 #endif // SNACC_DEEP_COPY
2269 void Extensions::Print (ostream
&os
) const
2272 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
2273 indentG
+= stdIndentG
;
2275 //for (; Curr() != NULL; GoNext())
2276 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
2278 Indent (os
, indentG
);
2281 //if (Curr() != Last())
2286 indentG
-= stdIndentG
;
2287 Indent (os
, indentG
);
2295 void Extensions::SetCurrElmt (unsigned long int index
)
2297 unsigned long int i
;
2300 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
2302 } // Extensions::SetCurrElmt
2305 unsigned long int Extensions::GetCurrElmtIndex()
2307 unsigned long int i
;
2311 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
2320 } // Extensions::GetCurrElmtIndex
2323 // alloc new list elmt, put at end of list
2324 // and return the component type
2325 Extension
*Extensions::Append()
2327 AsnListElmt
*newElmt
;
2328 newElmt
= new AsnListElmt
;
2329 newElmt
->elmt
= new Extension
;
2330 newElmt
->next
= NULL
;
2333 newElmt
->prev
= NULL
;
2334 first
= last
= newElmt
;
2338 newElmt
->prev
= last
;
2339 last
->next
= newElmt
;
2343 return (curr
= newElmt
)->elmt
;
2344 } // Extensions::Append
2347 // alloc new list elmt, put at begining of list
2348 // and return the component type
2349 Extension
*Extensions::Prepend()
2351 AsnListElmt
*newElmt
;
2352 newElmt
= new AsnListElmt
;
2353 newElmt
->elmt
= new Extension
;
2354 newElmt
->prev
= NULL
;
2357 newElmt
->next
= NULL
;
2358 first
= last
= newElmt
;
2362 newElmt
->next
= first
;
2363 first
->prev
= newElmt
;
2367 return (curr
= newElmt
)->elmt
;
2368 } // Extensions::Prepend
2371 // alloc new list elmt, insert it before the
2372 // current element and return the component type
2373 // if the current element is null, the new element
2374 // is placed at the beginning of the list.
2375 Extension
*Extensions::InsertBefore()
2377 AsnListElmt
*newElmt
;
2378 newElmt
= new AsnListElmt
;
2379 newElmt
->elmt
= new Extension
;
2382 newElmt
->next
= first
;
2383 newElmt
->prev
= NULL
;
2390 newElmt
->next
= curr
;
2391 newElmt
->prev
= curr
->prev
;
2392 curr
->prev
= newElmt
;
2396 newElmt
->prev
->next
= newElmt
;
2399 return (curr
= newElmt
)->elmt
;
2400 } // Extensions::InsertBefore
2403 // alloc new list elmt, insert it after the
2404 // current element and return the component type
2405 // if the current element is null, the new element
2406 // is placed at the end of the list.
2407 Extension
*Extensions::InsertAfter()
2409 AsnListElmt
*newElmt
;
2410 newElmt
= new AsnListElmt
;
2411 newElmt
->elmt
= new Extension
;
2414 newElmt
->prev
= last
;
2415 newElmt
->next
= NULL
;
2422 newElmt
->prev
= curr
;
2423 newElmt
->next
= curr
->next
;
2424 curr
->next
= newElmt
;
2428 newElmt
->next
->prev
= newElmt
;
2431 return (curr
= newElmt
)->elmt
;
2432 } // Extensions::InsertAfter
2435 Extensions
&Extensions::AppendCopy (Extension
&elmt
)
2437 AsnListElmt
*newElmt
;
2438 newElmt
= new AsnListElmt
;
2439 newElmt
->elmt
= new Extension
;
2440 *newElmt
->elmt
= elmt
;
2441 newElmt
->next
= NULL
;
2444 newElmt
->prev
= NULL
;
2445 first
= last
= newElmt
;
2449 newElmt
->prev
= last
;
2450 last
->next
= newElmt
;
2458 Extensions
&Extensions::PrependCopy (Extension
&elmt
)
2460 AsnListElmt
*newElmt
;
2461 newElmt
= new AsnListElmt
;
2462 newElmt
->elmt
= new Extension
;
2463 *newElmt
->elmt
= elmt
;
2464 newElmt
->prev
= NULL
;
2467 newElmt
->next
= NULL
;
2468 first
= last
= newElmt
;
2472 newElmt
->next
= first
;
2473 first
->prev
= newElmt
;
2478 } // Extensions::PrependCopy
2481 // alloc new list elmt, insert it before the
2482 // current element, copy the given elmt into the new elmt
2483 // and return the component type.
2484 // if the current element is null, the new element
2485 // is placed at the beginning of the list.
2486 Extensions
&Extensions::InsertBeforeAndCopy (Extension
&elmt
)
2488 AsnListElmt
*newElmt
;
2490 newElmt
= new AsnListElmt
;
2491 newElmt
->elmt
= new Extension
;
2492 *newElmt
->elmt
= elmt
;
2496 newElmt
->next
= first
;
2497 newElmt
->prev
= NULL
;
2504 newElmt
->next
= curr
;
2505 newElmt
->prev
= curr
->prev
;
2506 curr
->prev
= newElmt
;
2510 newElmt
->prev
->next
= newElmt
;
2514 } // Extensions::InsertBeforeAndCopy
2517 // alloc new list elmt, insert it after the
2518 // current element, copy given elmt in to new elmt
2519 // and return the component type
2520 // if the current element is null, the new element
2521 // is placed at the end of the list.
2522 Extensions
&Extensions::InsertAfterAndCopy (Extension
&elmt
)
2524 AsnListElmt
*newElmt
;
2526 newElmt
= new AsnListElmt
;
2527 newElmt
->elmt
= new Extension
;
2528 *newElmt
->elmt
= elmt
;
2531 newElmt
->prev
= last
;
2532 newElmt
->next
= NULL
;
2539 newElmt
->prev
= curr
;
2540 newElmt
->next
= curr
->next
;
2541 curr
->next
= newElmt
;
2545 newElmt
->next
->prev
= newElmt
;
2549 } // Extensions::InsertAfterAndCopy
2552 // remove current element from list if current element is not NULL
2553 // The new current element will be the next element.
2554 // If the current element is the last element in the list
2555 // the second but last element will become the new current element.
2556 void Extensions::RemoveCurrFromList()
2558 AsnListElmt
*del_elmt
;
2566 first
= last
= curr
= NULL
;
2567 else if (curr
== first
)
2569 curr
= first
= first
->next
;
2572 else if (curr
== last
)
2574 curr
= last
= last
->prev
;
2579 curr
->prev
->next
= curr
->next
;
2580 curr
->next
->prev
= curr
->prev
;
2583 delete del_elmt
->elmt
;
2589 AsnLen
Extensions::BEncContent (BUF_TYPE b
)
2591 AsnListElmt
*currElmt
;
2593 AsnLen totalLen
= 0;
2594 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
2597 elmtLen
= currElmt
->elmt
->BEncContent (b
);
2598 elmtLen
+= BEncConsLen (b
, elmtLen
);
2600 elmtLen
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2601 totalLen
+= elmtLen
;
2604 } // Extensions::BEncContent
2607 void Extensions::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
2608 AsnLen
&bytesDecoded
, ENV_TYPE env
)
2610 Extension
*listElmt
;
2612 AsnLen listBytesDecoded
= 0;
2615 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
2617 tag1
= BDecTag (b
, listBytesDecoded
, env
);
2618 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
2620 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
2623 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
2625 Asn1Error
<< "Unexpected Tag" << endl
;
2626 longjmp (env
, -125);
2629 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
2630 listElmt
= Append();
2631 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
2634 bytesDecoded
+= listBytesDecoded
;
2635 } // Extensions::BDecContent
2638 IssuerSerial::IssuerSerial()
2643 IssuerSerial::IssuerSerial (const IssuerSerial
&)
2645 Asn1Error
<< "use of incompletely defined IssuerSerial::IssuerSerial (const IssuerSerial &)" << endl
;
2649 IssuerSerial::~IssuerSerial()
2654 AsnType
*IssuerSerial::Clone() const
2656 return new IssuerSerial
;
2659 AsnType
*IssuerSerial::Copy() const
2661 return new IssuerSerial (*this);
2665 IssuerSerial
&IssuerSerial::operator = (const IssuerSerial
&that
)
2666 #else // SNACC_DEEP_COPY
2667 IssuerSerial
&IssuerSerial::operator = (const IssuerSerial
&)
2668 #endif // SNACC_DEEP_COPY
2673 issuer
= that
.issuer
;
2674 serial
= that
.serial
;
2678 issuerUID
= new UniqueIdentifier
;
2679 *issuerUID
= *that
.issuerUID
;
2689 #else // SNACC_DEEP_COPY
2690 Asn1Error
<< "use of incompletely defined IssuerSerial &IssuerSerial::operator = (const IssuerSerial &)" << endl
;
2692 // if your compiler complains here, check the -novolat option
2693 #endif // SNACC_DEEP_COPY
2697 IssuerSerial::BEncContent (BUF_TYPE b
)
2699 AsnLen totalLen
= 0;
2702 if (NOT_NULL (issuerUID
))
2704 l
= issuerUID
->BEncContent (b
);
2705 l
+= BEncDefLen (b
, l
);
2707 l
+= BEncTag1 (b
, UNIV
, PRIM
, BITSTRING_TAG_CODE
);
2711 l
= serial
.BEncContent (b
);
2712 l
+= BEncDefLen (b
, l
);
2714 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
2718 l
= issuer
.BEncContent (b
);
2719 l
+= BEncConsLen (b
, l
);
2721 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2725 } // IssuerSerial::BEncContent
2728 void IssuerSerial::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
2731 AsnLen seqBytesDecoded
= 0;
2733 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
2735 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
2737 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
2738 issuer
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
2739 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
2743 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
2744 longjmp (env
, -126);
2747 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))
2748 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, INTEGER_TAG_CODE
)))
2750 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
2751 serial
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
2752 if (seqBytesDecoded
== elmtLen0
)
2754 bytesDecoded
+= seqBytesDecoded
;
2759 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
2761 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
2763 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
2764 bytesDecoded
+= seqBytesDecoded
;
2771 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
2772 longjmp (env
, -127);
2775 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BITSTRING_TAG_CODE
))
2776 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, BITSTRING_TAG_CODE
)))
2778 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
2779 issuerUID
= new UniqueIdentifier
;
2780 issuerUID
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
2783 bytesDecoded
+= seqBytesDecoded
;
2784 if (elmtLen0
== INDEFINITE_LEN
)
2786 BDecEoc (b
, bytesDecoded
, env
);
2789 else if (seqBytesDecoded
!= elmtLen0
)
2791 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
2792 longjmp (env
, -128);
2796 } // IssuerSerial::BDecContent
2798 AsnLen
IssuerSerial::BEnc (BUF_TYPE b
)
2801 l
= BEncContent (b
);
2802 l
+= BEncConsLen (b
, l
);
2803 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2807 void IssuerSerial::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
2812 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
2814 Asn1Error
<< "IssuerSerial::BDec: ERROR - wrong tag" << endl
;
2815 longjmp (env
, -129);
2817 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
2818 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
2821 int IssuerSerial::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
2823 bytesEncoded
= BEnc (b
);
2824 return !b
.WriteError();
2827 int IssuerSerial::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
2833 if ((val
= setjmp (env
)) == 0)
2835 BDec (b
, bytesDecoded
, env
);
2836 return !b
.ReadError();
2842 void IssuerSerial::Print (ostream
&os
) const
2845 os
<< "{ -- SEQUENCE --" << endl
;
2846 indentG
+= stdIndentG
;
2849 Indent (os
, indentG
);
2856 Indent (os
, indentG
);
2862 if (NOT_NULL (issuerUID
))
2865 Indent (os
, indentG
);
2871 Indent (os
, indentG
);
2878 indentG
-= stdIndentG
;
2879 Indent (os
, indentG
);
2882 } // IssuerSerial::Print
2885 AttributeCertificateAssertionChoice::AttributeCertificateAssertionChoice()
2887 choiceId
= baseCertificateIDCid
;
2889 baseCertificateID
= new IssuerSerial
;
2891 baseCertificateID
= NULL
; // incomplete initialization of mandatory element!
2895 AttributeCertificateAssertionChoice::AttributeCertificateAssertionChoice (const AttributeCertificateAssertionChoice
&)
2897 Asn1Error
<< "use of incompletely defined AttributeCertificateAssertionChoice::AttributeCertificateAssertionChoice (const AttributeCertificateAssertionChoice &)" << endl
;
2901 AttributeCertificateAssertionChoice::~AttributeCertificateAssertionChoice()
2905 case baseCertificateIDCid
:
2906 delete baseCertificateID
;
2908 case subjectNameCid
:
2912 } // end of destructor
2914 AsnType
*AttributeCertificateAssertionChoice::Clone() const
2916 return new AttributeCertificateAssertionChoice
;
2919 AsnType
*AttributeCertificateAssertionChoice::Copy() const
2921 return new AttributeCertificateAssertionChoice (*this);
2925 AttributeCertificateAssertionChoice
&AttributeCertificateAssertionChoice::operator = (const AttributeCertificateAssertionChoice
&that
)
2926 #else // SNACC_DEEP_COPY
2927 AttributeCertificateAssertionChoice
&AttributeCertificateAssertionChoice::operator = (const AttributeCertificateAssertionChoice
&)
2928 #endif // SNACC_DEEP_COPY
2935 case baseCertificateIDCid
:
2936 delete baseCertificateID
;
2938 case subjectNameCid
:
2942 switch (choiceId
= that
.choiceId
)
2944 case baseCertificateIDCid
:
2945 baseCertificateID
= new IssuerSerial
;
2946 *baseCertificateID
= *that
.baseCertificateID
;
2948 case subjectNameCid
:
2949 subjectName
= new Name
;
2950 *subjectName
= *that
.subjectName
;
2956 #else // SNACC_DEEP_COPY
2957 Asn1Error
<< "use of incompletely defined AttributeCertificateAssertionChoice &AttributeCertificateAssertionChoice::operator = (const AttributeCertificateAssertionChoice &)" << endl
;
2959 // if your compiler complains here, check the -novolat option
2960 #endif // SNACC_DEEP_COPY
2964 AttributeCertificateAssertionChoice::BEncContent (BUF_TYPE b
)
2969 case baseCertificateIDCid
:
2972 l
= baseCertificateID
->BEncContent (b
);
2973 l
+= BEncConsLen (b
, l
);
2975 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
2976 l
+= BEncConsLen (b
, l
);
2978 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
2981 case subjectNameCid
:
2983 l
= subjectName
->BEncContent (b
);
2984 l
+= BEncConsLen (b
, l
);
2986 l
+= BEncTag1 (b
, CNTX
, CONS
, 1);
2991 } // AttributeCertificateAssertionChoice::BEncContent
2994 void AttributeCertificateAssertionChoice::BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
2999 case MAKE_TAG_ID (CNTX
, CONS
, 0):
3000 tag
= BDecTag (b
, bytesDecoded
, env
);
3001 if (tag
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
3003 Asn1Error
<< "Unexpected Tag" << endl
;
3004 longjmp (env
, -130);
3007 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
3008 choiceId
= baseCertificateIDCid
;
3009 baseCertificateID
= new IssuerSerial
;
3010 baseCertificateID
->BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
3011 if (elmtLen0
== INDEFINITE_LEN
)
3012 BDecEoc (b
, bytesDecoded
, env
);
3015 case MAKE_TAG_ID (CNTX
, CONS
, 1):
3016 tag
= BDecTag (b
, bytesDecoded
, env
);
3017 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
3018 choiceId
= subjectNameCid
;
3019 subjectName
= new Name
;
3020 subjectName
->BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
3021 if (elmtLen0
== INDEFINITE_LEN
)
3022 BDecEoc (b
, bytesDecoded
, env
);
3026 Asn1Error
<< "ERROR - unexpected tag in CHOICE" << endl
;
3027 longjmp (env
, -131);
3030 } // AttributeCertificateAssertionChoice::BDecContent
3033 AsnLen
AttributeCertificateAssertionChoice::BEnc (BUF_TYPE b
)
3036 l
= BEncContent (b
);
3040 void AttributeCertificateAssertionChoice::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
3045 /* CHOICEs are a special case - grab identifying tag */
3046 /* this allows easier handling of nested CHOICEs */
3047 tag
= BDecTag (b
, bytesDecoded
, env
);
3048 elmtLen
= BDecLen (b
, bytesDecoded
, env
);
3049 BDecContent (b
, tag
, elmtLen
, bytesDecoded
, env
);
3052 int AttributeCertificateAssertionChoice::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
3054 bytesEncoded
= BEnc (b
);
3055 return !b
.WriteError();
3058 int AttributeCertificateAssertionChoice::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
3064 if ((val
= setjmp (env
)) == 0)
3066 BDec (b
, bytesDecoded
, env
);
3067 return !b
.ReadError();
3073 void AttributeCertificateAssertionChoice::Print (ostream
&os
) const
3078 case baseCertificateIDCid
:
3079 os
<< "baseCertificateID ";
3080 if (baseCertificateID
)
3081 os
<< *baseCertificateID
;
3083 os
<< "-- void3 --\n";
3086 case subjectNameCid
:
3087 os
<< "subjectName ";
3091 os
<< "-- void3 --\n";
3096 } // AttributeCertificateAssertionChoice::Print
3098 AttributeCertificateInfoChoice::AttributeCertificateInfoChoice()
3100 choiceId
= baseCertificateIDCid
;
3102 baseCertificateID
= new IssuerSerial
;
3104 baseCertificateID
= NULL
; // incomplete initialization of mandatory element!
3108 AttributeCertificateInfoChoice::AttributeCertificateInfoChoice (const AttributeCertificateInfoChoice
&)
3110 Asn1Error
<< "use of incompletely defined AttributeCertificateInfoChoice::AttributeCertificateInfoChoice (const AttributeCertificateInfoChoice &)" << endl
;
3114 AttributeCertificateInfoChoice::~AttributeCertificateInfoChoice()
3118 case baseCertificateIDCid
:
3119 delete baseCertificateID
;
3121 case subjectNameCid
:
3125 } // end of destructor
3127 AsnType
*AttributeCertificateInfoChoice::Clone() const
3129 return new AttributeCertificateInfoChoice
;
3132 AsnType
*AttributeCertificateInfoChoice::Copy() const
3134 return new AttributeCertificateInfoChoice (*this);
3138 AttributeCertificateInfoChoice
&AttributeCertificateInfoChoice::operator = (const AttributeCertificateInfoChoice
&that
)
3139 #else // SNACC_DEEP_COPY
3140 AttributeCertificateInfoChoice
&AttributeCertificateInfoChoice::operator = (const AttributeCertificateInfoChoice
&)
3141 #endif // SNACC_DEEP_COPY
3148 case baseCertificateIDCid
:
3149 delete baseCertificateID
;
3151 case subjectNameCid
:
3155 switch (choiceId
= that
.choiceId
)
3157 case baseCertificateIDCid
:
3158 baseCertificateID
= new IssuerSerial
;
3159 *baseCertificateID
= *that
.baseCertificateID
;
3161 case subjectNameCid
:
3162 subjectName
= new GeneralNames
;
3163 *subjectName
= *that
.subjectName
;
3169 #else // SNACC_DEEP_COPY
3170 Asn1Error
<< "use of incompletely defined AttributeCertificateInfoChoice &AttributeCertificateInfoChoice::operator = (const AttributeCertificateInfoChoice &)" << endl
;
3172 // if your compiler complains here, check the -novolat option
3173 #endif // SNACC_DEEP_COPY
3177 AttributeCertificateInfoChoice::BEncContent (BUF_TYPE b
)
3182 case baseCertificateIDCid
:
3185 l
= baseCertificateID
->BEncContent (b
);
3186 l
+= BEncConsLen (b
, l
);
3188 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
3189 l
+= BEncConsLen (b
, l
);
3191 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
3194 case subjectNameCid
:
3197 l
= subjectName
->BEncContent (b
);
3198 l
+= BEncConsLen (b
, l
);
3200 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
3201 l
+= BEncConsLen (b
, l
);
3203 l
+= BEncTag1 (b
, CNTX
, CONS
, 1);
3208 } // AttributeCertificateInfoChoice::BEncContent
3211 void AttributeCertificateInfoChoice::BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
3216 case MAKE_TAG_ID (CNTX
, CONS
, 0):
3217 tag
= BDecTag (b
, bytesDecoded
, env
);
3218 if (tag
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
3220 Asn1Error
<< "Unexpected Tag" << endl
;
3221 longjmp (env
, -132);
3224 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
3225 choiceId
= baseCertificateIDCid
;
3226 baseCertificateID
= new IssuerSerial
;
3227 baseCertificateID
->BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
3228 if (elmtLen0
== INDEFINITE_LEN
)
3229 BDecEoc (b
, bytesDecoded
, env
);
3232 case MAKE_TAG_ID (CNTX
, CONS
, 1):
3233 tag
= BDecTag (b
, bytesDecoded
, env
);
3234 if (tag
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
3236 Asn1Error
<< "Unexpected Tag" << endl
;
3237 longjmp (env
, -133);
3240 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
3241 choiceId
= subjectNameCid
;
3242 subjectName
= new GeneralNames
;
3243 subjectName
->BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
3244 if (elmtLen0
== INDEFINITE_LEN
)
3245 BDecEoc (b
, bytesDecoded
, env
);
3249 Asn1Error
<< "ERROR - unexpected tag in CHOICE" << endl
;
3250 longjmp (env
, -134);
3253 } // AttributeCertificateInfoChoice::BDecContent
3256 AsnLen
AttributeCertificateInfoChoice::BEnc (BUF_TYPE b
)
3259 l
= BEncContent (b
);
3263 void AttributeCertificateInfoChoice::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
3268 /* CHOICEs are a special case - grab identifying tag */
3269 /* this allows easier handling of nested CHOICEs */
3270 tag
= BDecTag (b
, bytesDecoded
, env
);
3271 elmtLen
= BDecLen (b
, bytesDecoded
, env
);
3272 BDecContent (b
, tag
, elmtLen
, bytesDecoded
, env
);
3275 int AttributeCertificateInfoChoice::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
3277 bytesEncoded
= BEnc (b
);
3278 return !b
.WriteError();
3281 int AttributeCertificateInfoChoice::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
3287 if ((val
= setjmp (env
)) == 0)
3289 BDec (b
, bytesDecoded
, env
);
3290 return !b
.ReadError();
3296 void AttributeCertificateInfoChoice::Print (ostream
&os
) const
3301 case baseCertificateIDCid
:
3302 os
<< "baseCertificateID ";
3303 if (baseCertificateID
)
3304 os
<< *baseCertificateID
;
3306 os
<< "-- void3 --\n";
3309 case subjectNameCid
:
3310 os
<< "subjectName ";
3314 os
<< "-- void3 --\n";
3319 } // AttributeCertificateInfoChoice::Print
3321 CRLToSignSeqOfSeq::CRLToSignSeqOfSeq()
3324 revocationDate
= new Time
;
3326 revocationDate
= NULL
; // incomplete initialization of mandatory element!
3328 crlEntryExtensions
= NULL
;
3331 CRLToSignSeqOfSeq::CRLToSignSeqOfSeq (const CRLToSignSeqOfSeq
&)
3333 Asn1Error
<< "use of incompletely defined CRLToSignSeqOfSeq::CRLToSignSeqOfSeq (const CRLToSignSeqOfSeq &)" << endl
;
3337 CRLToSignSeqOfSeq::~CRLToSignSeqOfSeq()
3339 delete revocationDate
;
3340 delete crlEntryExtensions
;
3343 AsnType
*CRLToSignSeqOfSeq::Clone() const
3345 return new CRLToSignSeqOfSeq
;
3348 AsnType
*CRLToSignSeqOfSeq::Copy() const
3350 return new CRLToSignSeqOfSeq (*this);
3354 CRLToSignSeqOfSeq
&CRLToSignSeqOfSeq::operator = (const CRLToSignSeqOfSeq
&that
)
3355 #else // SNACC_DEEP_COPY
3356 CRLToSignSeqOfSeq
&CRLToSignSeqOfSeq::operator = (const CRLToSignSeqOfSeq
&)
3357 #endif // SNACC_DEEP_COPY
3362 userCertificate
= that
.userCertificate
;
3363 if (that
.revocationDate
)
3365 if (!revocationDate
)
3366 revocationDate
= new Time
;
3367 *revocationDate
= *that
.revocationDate
;
3371 delete revocationDate
;
3372 revocationDate
= NULL
;
3374 if (that
.crlEntryExtensions
)
3376 if (!crlEntryExtensions
)
3377 crlEntryExtensions
= new Extensions
;
3378 *crlEntryExtensions
= *that
.crlEntryExtensions
;
3382 delete crlEntryExtensions
;
3383 crlEntryExtensions
= NULL
;
3388 #else // SNACC_DEEP_COPY
3389 Asn1Error
<< "use of incompletely defined CRLToSignSeqOfSeq &CRLToSignSeqOfSeq::operator = (const CRLToSignSeqOfSeq &)" << endl
;
3391 // if your compiler complains here, check the -novolat option
3392 #endif // SNACC_DEEP_COPY
3396 CRLToSignSeqOfSeq::BEncContent (BUF_TYPE b
)
3398 AsnLen totalLen
= 0;
3401 if (NOT_NULL (crlEntryExtensions
))
3404 l
= crlEntryExtensions
->BEncContent (b
);
3405 l
+= BEncConsLen (b
, l
);
3407 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
3411 l
= revocationDate
->BEncContent (b
);
3414 l
= userCertificate
.BEncContent (b
);
3415 l
+= BEncDefLen (b
, l
);
3417 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
3421 } // CRLToSignSeqOfSeq::BEncContent
3424 void CRLToSignSeqOfSeq::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
3427 AsnLen seqBytesDecoded
= 0;
3429 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
3431 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))
3432 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, INTEGER_TAG_CODE
)))
3434 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
3435 userCertificate
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
3436 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
3440 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
3441 longjmp (env
, -135);
3444 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
))
3445 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
))
3446 || (tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
3447 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
3449 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
3450 revocationDate
= new Time
;
3451 revocationDate
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
3452 if (seqBytesDecoded
== elmtLen0
)
3454 bytesDecoded
+= seqBytesDecoded
;
3459 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
3461 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
3463 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
3464 bytesDecoded
+= seqBytesDecoded
;
3471 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
3472 longjmp (env
, -136);
3475 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
3477 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
3478 crlEntryExtensions
= new Extensions
;
3479 crlEntryExtensions
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
3482 bytesDecoded
+= seqBytesDecoded
;
3483 if (elmtLen0
== INDEFINITE_LEN
)
3485 BDecEoc (b
, bytesDecoded
, env
);
3488 else if (seqBytesDecoded
!= elmtLen0
)
3490 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
3491 longjmp (env
, -137);
3495 } // CRLToSignSeqOfSeq::BDecContent
3497 AsnLen
CRLToSignSeqOfSeq::BEnc (BUF_TYPE b
)
3500 l
= BEncContent (b
);
3501 l
+= BEncConsLen (b
, l
);
3502 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
3506 void CRLToSignSeqOfSeq::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
3511 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
3513 Asn1Error
<< "CRLToSignSeqOfSeq::BDec: ERROR - wrong tag" << endl
;
3514 longjmp (env
, -138);
3516 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
3517 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
3520 int CRLToSignSeqOfSeq::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
3522 bytesEncoded
= BEnc (b
);
3523 return !b
.WriteError();
3526 int CRLToSignSeqOfSeq::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
3532 if ((val
= setjmp (env
)) == 0)
3534 BDec (b
, bytesDecoded
, env
);
3535 return !b
.ReadError();
3541 void CRLToSignSeqOfSeq::Print (ostream
&os
) const
3544 os
<< "{ -- SEQUENCE --" << endl
;
3545 indentG
+= stdIndentG
;
3548 Indent (os
, indentG
);
3549 os
<< "userCertificate ";
3550 os
<< userCertificate
;
3554 if (NOT_NULL (revocationDate
))
3556 Indent (os
, indentG
);
3557 os
<< "revocationDate ";
3558 os
<< *revocationDate
;
3562 Indent (os
, indentG
);
3563 os
<< "revocationDate ";
3568 if (NOT_NULL (crlEntryExtensions
))
3571 Indent (os
, indentG
);
3572 os
<< "crlEntryExtensions ";
3573 os
<< *crlEntryExtensions
;
3577 Indent (os
, indentG
);
3578 os
<< "crlEntryExtensions ";
3584 indentG
-= stdIndentG
;
3585 Indent (os
, indentG
);
3588 } // CRLToSignSeqOfSeq::Print
3591 AsnType
*CRLToSignSeqOf::Clone() const
3593 return new CRLToSignSeqOf
;
3596 AsnType
*CRLToSignSeqOf::Copy() const
3598 return new CRLToSignSeqOf (*this);
3601 AsnLen
CRLToSignSeqOf::BEnc (BUF_TYPE b
)
3604 l
= BEncContent (b
);
3605 l
+= BEncConsLen (b
, l
);
3606 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
3610 void CRLToSignSeqOf::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
3615 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
3617 Asn1Error
<< "CRLToSignSeqOf::BDec: ERROR - wrong tag" << endl
;
3618 longjmp (env
, -139);
3620 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
3621 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
3624 CRLToSignSeqOf::CRLToSignSeqOf (const CRLToSignSeqOf
&)
3626 Asn1Error
<< "use of incompletely defined CRLToSignSeqOf::CRLToSignSeqOf (const CRLToSignSeqOf &)" << endl
;
3630 CRLToSignSeqOf::~CRLToSignSeqOf()
3633 for (; Curr() != NULL
; RemoveCurrFromList())
3635 } // end of destructor
3638 CRLToSignSeqOf
&CRLToSignSeqOf::operator = (const CRLToSignSeqOf
&that
)
3639 #else // SNACC_DEEP_COPY
3640 CRLToSignSeqOf
&CRLToSignSeqOf::operator = (const CRLToSignSeqOf
&)
3641 #endif // SNACC_DEEP_COPY
3647 for (; Curr(); RemoveCurrFromList())
3650 //that.SetCurrToFirst();
3651 //for (; that.Curr(); that.GoNext())
3652 // AppendCopy (*that.Curr());
3653 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
3654 AppendCopy (*run
->elmt
);
3658 #else // SNACC_DEEP_COPY
3659 Asn1Error
<< "use of incompletely defined CRLToSignSeqOf &CRLToSignSeqOf::operator = (const CRLToSignSeqOf &)" << endl
;
3661 // if your compiler complains here, check the -novolat option
3662 #endif // SNACC_DEEP_COPY
3665 void CRLToSignSeqOf::Print (ostream
&os
) const
3668 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
3669 indentG
+= stdIndentG
;
3671 //for (; Curr() != NULL; GoNext())
3672 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
3674 Indent (os
, indentG
);
3677 //if (Curr() != Last())
3682 indentG
-= stdIndentG
;
3683 Indent (os
, indentG
);
3691 void CRLToSignSeqOf::SetCurrElmt (unsigned long int index
)
3693 unsigned long int i
;
3696 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
3698 } // CRLToSignSeqOf::SetCurrElmt
3701 unsigned long int CRLToSignSeqOf::GetCurrElmtIndex()
3703 unsigned long int i
;
3707 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
3716 } // CRLToSignSeqOf::GetCurrElmtIndex
3719 // alloc new list elmt, put at end of list
3720 // and return the component type
3721 CRLToSignSeqOfSeq
*CRLToSignSeqOf::Append()
3723 AsnListElmt
*newElmt
;
3724 newElmt
= new AsnListElmt
;
3725 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3726 newElmt
->next
= NULL
;
3729 newElmt
->prev
= NULL
;
3730 first
= last
= newElmt
;
3734 newElmt
->prev
= last
;
3735 last
->next
= newElmt
;
3739 return (curr
= newElmt
)->elmt
;
3740 } // CRLToSignSeqOf::Append
3743 // alloc new list elmt, put at begining of list
3744 // and return the component type
3745 CRLToSignSeqOfSeq
*CRLToSignSeqOf::Prepend()
3747 AsnListElmt
*newElmt
;
3748 newElmt
= new AsnListElmt
;
3749 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3750 newElmt
->prev
= NULL
;
3753 newElmt
->next
= NULL
;
3754 first
= last
= newElmt
;
3758 newElmt
->next
= first
;
3759 first
->prev
= newElmt
;
3763 return (curr
= newElmt
)->elmt
;
3764 } // CRLToSignSeqOf::Prepend
3767 // alloc new list elmt, insert it before the
3768 // current element and return the component type
3769 // if the current element is null, the new element
3770 // is placed at the beginning of the list.
3771 CRLToSignSeqOfSeq
*CRLToSignSeqOf::InsertBefore()
3773 AsnListElmt
*newElmt
;
3774 newElmt
= new AsnListElmt
;
3775 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3778 newElmt
->next
= first
;
3779 newElmt
->prev
= NULL
;
3786 newElmt
->next
= curr
;
3787 newElmt
->prev
= curr
->prev
;
3788 curr
->prev
= newElmt
;
3792 newElmt
->prev
->next
= newElmt
;
3795 return (curr
= newElmt
)->elmt
;
3796 } // CRLToSignSeqOf::InsertBefore
3799 // alloc new list elmt, insert it after the
3800 // current element and return the component type
3801 // if the current element is null, the new element
3802 // is placed at the end of the list.
3803 CRLToSignSeqOfSeq
*CRLToSignSeqOf::InsertAfter()
3805 AsnListElmt
*newElmt
;
3806 newElmt
= new AsnListElmt
;
3807 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3810 newElmt
->prev
= last
;
3811 newElmt
->next
= NULL
;
3818 newElmt
->prev
= curr
;
3819 newElmt
->next
= curr
->next
;
3820 curr
->next
= newElmt
;
3824 newElmt
->next
->prev
= newElmt
;
3827 return (curr
= newElmt
)->elmt
;
3828 } // CRLToSignSeqOf::InsertAfter
3831 CRLToSignSeqOf
&CRLToSignSeqOf::AppendCopy (CRLToSignSeqOfSeq
&elmt
)
3833 AsnListElmt
*newElmt
;
3834 newElmt
= new AsnListElmt
;
3835 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3836 *newElmt
->elmt
= elmt
;
3837 newElmt
->next
= NULL
;
3840 newElmt
->prev
= NULL
;
3841 first
= last
= newElmt
;
3845 newElmt
->prev
= last
;
3846 last
->next
= newElmt
;
3854 CRLToSignSeqOf
&CRLToSignSeqOf::PrependCopy (CRLToSignSeqOfSeq
&elmt
)
3856 AsnListElmt
*newElmt
;
3857 newElmt
= new AsnListElmt
;
3858 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3859 *newElmt
->elmt
= elmt
;
3860 newElmt
->prev
= NULL
;
3863 newElmt
->next
= NULL
;
3864 first
= last
= newElmt
;
3868 newElmt
->next
= first
;
3869 first
->prev
= newElmt
;
3874 } // CRLToSignSeqOf::PrependCopy
3877 // alloc new list elmt, insert it before the
3878 // current element, copy the given elmt into the new elmt
3879 // and return the component type.
3880 // if the current element is null, the new element
3881 // is placed at the beginning of the list.
3882 CRLToSignSeqOf
&CRLToSignSeqOf::InsertBeforeAndCopy (CRLToSignSeqOfSeq
&elmt
)
3884 AsnListElmt
*newElmt
;
3886 newElmt
= new AsnListElmt
;
3887 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3888 *newElmt
->elmt
= elmt
;
3892 newElmt
->next
= first
;
3893 newElmt
->prev
= NULL
;
3900 newElmt
->next
= curr
;
3901 newElmt
->prev
= curr
->prev
;
3902 curr
->prev
= newElmt
;
3906 newElmt
->prev
->next
= newElmt
;
3910 } // CRLToSignSeqOf::InsertBeforeAndCopy
3913 // alloc new list elmt, insert it after the
3914 // current element, copy given elmt in to new elmt
3915 // and return the component type
3916 // if the current element is null, the new element
3917 // is placed at the end of the list.
3918 CRLToSignSeqOf
&CRLToSignSeqOf::InsertAfterAndCopy (CRLToSignSeqOfSeq
&elmt
)
3920 AsnListElmt
*newElmt
;
3922 newElmt
= new AsnListElmt
;
3923 newElmt
->elmt
= new CRLToSignSeqOfSeq
;
3924 *newElmt
->elmt
= elmt
;
3927 newElmt
->prev
= last
;
3928 newElmt
->next
= NULL
;
3935 newElmt
->prev
= curr
;
3936 newElmt
->next
= curr
->next
;
3937 curr
->next
= newElmt
;
3941 newElmt
->next
->prev
= newElmt
;
3945 } // CRLToSignSeqOf::InsertAfterAndCopy
3948 // remove current element from list if current element is not NULL
3949 // The new current element will be the next element.
3950 // If the current element is the last element in the list
3951 // the second but last element will become the new current element.
3952 void CRLToSignSeqOf::RemoveCurrFromList()
3954 AsnListElmt
*del_elmt
;
3962 first
= last
= curr
= NULL
;
3963 else if (curr
== first
)
3965 curr
= first
= first
->next
;
3968 else if (curr
== last
)
3970 curr
= last
= last
->prev
;
3975 curr
->prev
->next
= curr
->next
;
3976 curr
->next
->prev
= curr
->prev
;
3979 delete del_elmt
->elmt
;
3985 AsnLen
CRLToSignSeqOf::BEncContent (BUF_TYPE b
)
3987 AsnListElmt
*currElmt
;
3989 AsnLen totalLen
= 0;
3990 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
3993 elmtLen
= currElmt
->elmt
->BEncContent (b
);
3994 elmtLen
+= BEncConsLen (b
, elmtLen
);
3996 elmtLen
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
3997 totalLen
+= elmtLen
;
4000 } // CRLToSignSeqOf::BEncContent
4003 void CRLToSignSeqOf::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
4004 AsnLen
&bytesDecoded
, ENV_TYPE env
)
4006 CRLToSignSeqOfSeq
*listElmt
;
4008 AsnLen listBytesDecoded
= 0;
4011 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
4013 tag1
= BDecTag (b
, listBytesDecoded
, env
);
4014 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
4016 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
4019 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4021 Asn1Error
<< "Unexpected Tag" << endl
;
4022 longjmp (env
, -140);
4025 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
4026 listElmt
= Append();
4027 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
4030 bytesDecoded
+= listBytesDecoded
;
4031 } // CRLToSignSeqOf::BDecContent
4034 CertificateToSign::CertificateToSign()
4038 signature
= new AlgorithmIdentifier
;
4040 signature
= NULL
; // incomplete initialization of mandatory element!
4045 issuer
= NULL
; // incomplete initialization of mandatory element!
4048 validity
= new Validity
;
4050 validity
= NULL
; // incomplete initialization of mandatory element!
4055 subject
= NULL
; // incomplete initialization of mandatory element!
4058 subjectPublicKeyInfo
= new SubjectPublicKeyInfo
;
4060 subjectPublicKeyInfo
= NULL
; // incomplete initialization of mandatory element!
4062 issuerUniqueIdentifier
= NULL
;
4063 subjectUniqueIdentifier
= NULL
;
4067 CertificateToSign::CertificateToSign (const CertificateToSign
&)
4069 Asn1Error
<< "use of incompletely defined CertificateToSign::CertificateToSign (const CertificateToSign &)" << endl
;
4073 CertificateToSign::~CertificateToSign()
4080 delete subjectPublicKeyInfo
;
4081 delete issuerUniqueIdentifier
;
4082 delete subjectUniqueIdentifier
;
4086 AsnType
*CertificateToSign::Clone() const
4088 return new CertificateToSign
;
4091 AsnType
*CertificateToSign::Copy() const
4093 return new CertificateToSign (*this);
4097 CertificateToSign
&CertificateToSign::operator = (const CertificateToSign
&that
)
4098 #else // SNACC_DEEP_COPY
4099 CertificateToSign
&CertificateToSign::operator = (const CertificateToSign
&)
4100 #endif // SNACC_DEEP_COPY
4108 version
= new Version
;
4109 *version
= *that
.version
;
4116 serialNumber
= that
.serialNumber
;
4120 signature
= new AlgorithmIdentifier
;
4121 *signature
= *that
.signature
;
4132 *issuer
= *that
.issuer
;
4142 validity
= new Validity
;
4143 *validity
= *that
.validity
;
4154 *subject
= *that
.subject
;
4161 if (that
.subjectPublicKeyInfo
)
4163 if (!subjectPublicKeyInfo
)
4164 subjectPublicKeyInfo
= new SubjectPublicKeyInfo
;
4165 *subjectPublicKeyInfo
= *that
.subjectPublicKeyInfo
;
4169 delete subjectPublicKeyInfo
;
4170 subjectPublicKeyInfo
= NULL
;
4172 if (that
.issuerUniqueIdentifier
)
4174 if (!issuerUniqueIdentifier
)
4175 issuerUniqueIdentifier
= new UniqueIdentifier
;
4176 *issuerUniqueIdentifier
= *that
.issuerUniqueIdentifier
;
4180 delete issuerUniqueIdentifier
;
4181 issuerUniqueIdentifier
= NULL
;
4183 if (that
.subjectUniqueIdentifier
)
4185 if (!subjectUniqueIdentifier
)
4186 subjectUniqueIdentifier
= new UniqueIdentifier
;
4187 *subjectUniqueIdentifier
= *that
.subjectUniqueIdentifier
;
4191 delete subjectUniqueIdentifier
;
4192 subjectUniqueIdentifier
= NULL
;
4194 if (that
.extensions
)
4197 extensions
= new Extensions
;
4198 *extensions
= *that
.extensions
;
4208 #else // SNACC_DEEP_COPY
4209 Asn1Error
<< "use of incompletely defined CertificateToSign &CertificateToSign::operator = (const CertificateToSign &)" << endl
;
4211 // if your compiler complains here, check the -novolat option
4212 #endif // SNACC_DEEP_COPY
4216 CertificateToSign::BEncContent (BUF_TYPE b
)
4218 AsnLen totalLen
= 0;
4221 if (NOT_NULL (extensions
))
4225 l
= extensions
->BEncContent (b
);
4226 l
+= BEncConsLen (b
, l
);
4228 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4229 l
+= BEncConsLen (b
, l
);
4231 l
+= BEncTag1 (b
, CNTX
, CONS
, 3);
4235 if (NOT_NULL (subjectUniqueIdentifier
))
4237 l
= subjectUniqueIdentifier
->BEncContent (b
);
4238 l
+= BEncDefLen (b
, l
);
4240 l
+= BEncTag1 (b
, CNTX
, PRIM
, 2);
4244 if (NOT_NULL (issuerUniqueIdentifier
))
4246 l
= issuerUniqueIdentifier
->BEncContent (b
);
4247 l
+= BEncDefLen (b
, l
);
4249 l
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
4254 l
= subjectPublicKeyInfo
->BEncContent (b
);
4255 l
+= BEncConsLen (b
, l
);
4257 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4260 l
= subject
->BEncContent (b
);
4264 l
= validity
->BEncContent (b
);
4265 l
+= BEncConsLen (b
, l
);
4267 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4270 l
= issuer
->BEncContent (b
);
4274 l
= signature
->BEncContent (b
);
4275 l
+= BEncConsLen (b
, l
);
4277 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4280 l
= serialNumber
.BEncContent (b
);
4281 l
+= BEncDefLen (b
, l
);
4283 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
4286 if (NOT_NULL (version
))
4289 l
= version
->BEncContent (b
);
4290 BEncDefLenTo127 (b
, l
);
4293 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
4294 l
+= BEncConsLen (b
, l
);
4296 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
4301 } // CertificateToSign::BEncContent
4304 void CertificateToSign::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
4307 AsnLen seqBytesDecoded
= 0;
4310 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4312 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0)))
4314 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4315 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4317 if (tag1
!= MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))
4319 Asn1Error
<< "Unexpected Tag" << endl
;
4320 longjmp (env
, -141);
4323 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
4324 version
= new Version
;
4325 version
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
4326 if (elmtLen1
== INDEFINITE_LEN
)
4327 BDecEoc (b
, seqBytesDecoded
, env
);
4329 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4332 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))
4333 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, INTEGER_TAG_CODE
)))
4335 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4336 serialNumber
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4337 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4341 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4342 longjmp (env
, -142);
4345 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4347 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4348 signature
= new AlgorithmIdentifier
;
4349 signature
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4350 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4354 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4355 longjmp (env
, -143);
4358 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4360 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4362 issuer
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4363 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4367 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4368 longjmp (env
, -144);
4371 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4373 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4374 validity
= new Validity
;
4375 validity
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4376 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4380 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4381 longjmp (env
, -145);
4384 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4386 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4388 subject
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4389 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4393 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4394 longjmp (env
, -146);
4397 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4399 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4400 subjectPublicKeyInfo
= new SubjectPublicKeyInfo
;
4401 subjectPublicKeyInfo
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4402 if (seqBytesDecoded
== elmtLen0
)
4404 bytesDecoded
+= seqBytesDecoded
;
4409 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4411 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
4413 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
4414 bytesDecoded
+= seqBytesDecoded
;
4421 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4422 longjmp (env
, -147);
4425 if ((tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))
4426 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1)))
4428 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4429 issuerUniqueIdentifier
= new UniqueIdentifier
;
4430 issuerUniqueIdentifier
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4431 if (seqBytesDecoded
== elmtLen0
)
4433 bytesDecoded
+= seqBytesDecoded
;
4438 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4440 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
4442 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
4443 bytesDecoded
+= seqBytesDecoded
;
4449 if ((tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 2))
4450 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 2)))
4452 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4453 subjectUniqueIdentifier
= new UniqueIdentifier
;
4454 subjectUniqueIdentifier
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4455 if (seqBytesDecoded
== elmtLen0
)
4457 bytesDecoded
+= seqBytesDecoded
;
4462 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4464 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
4466 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
4467 bytesDecoded
+= seqBytesDecoded
;
4473 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 3)))
4475 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4476 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4478 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
4480 Asn1Error
<< "Unexpected Tag" << endl
;
4481 longjmp (env
, -148);
4484 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
4485 extensions
= new Extensions
;
4486 extensions
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
4487 if (elmtLen1
== INDEFINITE_LEN
)
4488 BDecEoc (b
, seqBytesDecoded
, env
);
4492 bytesDecoded
+= seqBytesDecoded
;
4493 if (elmtLen0
== INDEFINITE_LEN
)
4495 BDecEoc (b
, bytesDecoded
, env
);
4498 else if (seqBytesDecoded
!= elmtLen0
)
4500 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
4501 longjmp (env
, -149);
4505 } // CertificateToSign::BDecContent
4507 AsnLen
CertificateToSign::BEnc (BUF_TYPE b
)
4510 l
= BEncContent (b
);
4511 l
+= BEncConsLen (b
, l
);
4512 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4516 void CertificateToSign::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
4521 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
4523 Asn1Error
<< "CertificateToSign::BDec: ERROR - wrong tag" << endl
;
4524 longjmp (env
, -150);
4526 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
4527 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
4530 int CertificateToSign::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
4532 bytesEncoded
= BEnc (b
);
4533 return !b
.WriteError();
4536 int CertificateToSign::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
4542 if ((val
= setjmp (env
)) == 0)
4544 BDec (b
, bytesDecoded
, env
);
4545 return !b
.ReadError();
4551 void CertificateToSign::Print (ostream
&os
) const
4554 os
<< "{ -- SEQUENCE --" << endl
;
4555 indentG
+= stdIndentG
;
4557 if (NOT_NULL (version
))
4559 Indent (os
, indentG
);
4565 Indent (os
, indentG
);
4572 Indent (os
, indentG
);
4573 os
<< "serialNumber ";
4578 if (NOT_NULL (signature
))
4580 Indent (os
, indentG
);
4586 Indent (os
, indentG
);
4592 if (NOT_NULL (issuer
))
4594 Indent (os
, indentG
);
4600 Indent (os
, indentG
);
4606 if (NOT_NULL (validity
))
4608 Indent (os
, indentG
);
4614 Indent (os
, indentG
);
4620 if (NOT_NULL (subject
))
4622 Indent (os
, indentG
);
4628 Indent (os
, indentG
);
4634 if (NOT_NULL (subjectPublicKeyInfo
))
4636 Indent (os
, indentG
);
4637 os
<< "subjectPublicKeyInfo ";
4638 os
<< *subjectPublicKeyInfo
;
4642 Indent (os
, indentG
);
4643 os
<< "subjectPublicKeyInfo ";
4648 if (NOT_NULL (issuerUniqueIdentifier
))
4651 Indent (os
, indentG
);
4652 os
<< "issuerUniqueIdentifier ";
4653 os
<< *issuerUniqueIdentifier
;
4657 Indent (os
, indentG
);
4658 os
<< "issuerUniqueIdentifier ";
4663 if (NOT_NULL (subjectUniqueIdentifier
))
4666 Indent (os
, indentG
);
4667 os
<< "subjectUniqueIdentifier ";
4668 os
<< *subjectUniqueIdentifier
;
4672 Indent (os
, indentG
);
4673 os
<< "subjectUniqueIdentifier ";
4678 if (NOT_NULL (extensions
))
4681 Indent (os
, indentG
);
4682 os
<< "extensions ";
4687 Indent (os
, indentG
);
4688 os
<< "extensions ";
4694 indentG
-= stdIndentG
;
4695 Indent (os
, indentG
);
4698 } // CertificateToSign::Print
4701 CRLToSign::CRLToSign()
4705 signature
= new AlgorithmIdentifier
;
4707 signature
= NULL
; // incomplete initialization of mandatory element!
4712 issuer
= NULL
; // incomplete initialization of mandatory element!
4715 thisUpdate
= new Time
;
4717 thisUpdate
= NULL
; // incomplete initialization of mandatory element!
4720 revokedCertificates
= NULL
;
4721 crlExtensions
= NULL
;
4724 CRLToSign::CRLToSign (const CRLToSign
&)
4726 Asn1Error
<< "use of incompletely defined CRLToSign::CRLToSign (const CRLToSign &)" << endl
;
4730 CRLToSign::~CRLToSign()
4737 delete revokedCertificates
;
4738 delete crlExtensions
;
4741 AsnType
*CRLToSign::Clone() const
4743 return new CRLToSign
;
4746 AsnType
*CRLToSign::Copy() const
4748 return new CRLToSign (*this);
4752 CRLToSign
&CRLToSign::operator = (const CRLToSign
&that
)
4753 #else // SNACC_DEEP_COPY
4754 CRLToSign
&CRLToSign::operator = (const CRLToSign
&)
4755 #endif // SNACC_DEEP_COPY
4763 version
= new Version
;
4764 *version
= *that
.version
;
4774 signature
= new AlgorithmIdentifier
;
4775 *signature
= *that
.signature
;
4786 *issuer
= *that
.issuer
;
4793 if (that
.thisUpdate
)
4796 thisUpdate
= new Time
;
4797 *thisUpdate
= *that
.thisUpdate
;
4804 if (that
.nextUpdate
)
4807 nextUpdate
= new Time
;
4808 *nextUpdate
= *that
.nextUpdate
;
4815 if (that
.revokedCertificates
)
4817 if (!revokedCertificates
)
4818 revokedCertificates
= new CRLToSignSeqOf
;
4819 *revokedCertificates
= *that
.revokedCertificates
;
4823 delete revokedCertificates
;
4824 revokedCertificates
= NULL
;
4826 if (that
.crlExtensions
)
4829 crlExtensions
= new Extensions
;
4830 *crlExtensions
= *that
.crlExtensions
;
4834 delete crlExtensions
;
4835 crlExtensions
= NULL
;
4840 #else // SNACC_DEEP_COPY
4841 Asn1Error
<< "use of incompletely defined CRLToSign &CRLToSign::operator = (const CRLToSign &)" << endl
;
4843 // if your compiler complains here, check the -novolat option
4844 #endif // SNACC_DEEP_COPY
4848 CRLToSign::BEncContent (BUF_TYPE b
)
4850 AsnLen totalLen
= 0;
4853 if (NOT_NULL (crlExtensions
))
4857 l
= crlExtensions
->BEncContent (b
);
4858 l
+= BEncConsLen (b
, l
);
4860 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4861 l
+= BEncConsLen (b
, l
);
4863 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
4867 if (NOT_NULL (revokedCertificates
))
4870 l
= revokedCertificates
->BEncContent (b
);
4871 l
+= BEncConsLen (b
, l
);
4873 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4877 if (NOT_NULL (nextUpdate
))
4879 l
= nextUpdate
->BEncContent (b
);
4883 l
= thisUpdate
->BEncContent (b
);
4886 l
= issuer
->BEncContent (b
);
4890 l
= signature
->BEncContent (b
);
4891 l
+= BEncConsLen (b
, l
);
4893 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
4896 if (NOT_NULL (version
))
4898 l
= version
->BEncContent (b
);
4899 BEncDefLenTo127 (b
, l
);
4902 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
4907 } // CRLToSign::BEncContent
4910 void CRLToSign::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
4913 AsnLen seqBytesDecoded
= 0;
4916 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4918 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
)))
4920 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4921 version
= new Version
;
4922 version
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4923 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4926 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4928 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4929 signature
= new AlgorithmIdentifier
;
4930 signature
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4931 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4935 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4936 longjmp (env
, -151);
4939 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
4941 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4943 issuer
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4944 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4948 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4949 longjmp (env
, -152);
4952 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
))
4953 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
))
4954 || (tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
4955 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
4957 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4958 thisUpdate
= new Time
;
4959 thisUpdate
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4960 if (seqBytesDecoded
== elmtLen0
)
4962 bytesDecoded
+= seqBytesDecoded
;
4967 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
4969 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
4971 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
4972 bytesDecoded
+= seqBytesDecoded
;
4979 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
4980 longjmp (env
, -153);
4983 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
))
4984 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
))
4985 || (tag1
== MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
4986 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
4988 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
4989 nextUpdate
= new Time
;
4990 nextUpdate
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
4991 if (seqBytesDecoded
== elmtLen0
)
4993 bytesDecoded
+= seqBytesDecoded
;
4998 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5000 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
5002 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
5003 bytesDecoded
+= seqBytesDecoded
;
5009 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5011 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5012 revokedCertificates
= new CRLToSignSeqOf
;
5013 revokedCertificates
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5014 if (seqBytesDecoded
== elmtLen0
)
5016 bytesDecoded
+= seqBytesDecoded
;
5021 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5023 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
5025 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
5026 bytesDecoded
+= seqBytesDecoded
;
5032 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0)))
5034 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5035 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5037 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
5039 Asn1Error
<< "Unexpected Tag" << endl
;
5040 longjmp (env
, -154);
5043 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
5044 crlExtensions
= new Extensions
;
5045 crlExtensions
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
5046 if (elmtLen1
== INDEFINITE_LEN
)
5047 BDecEoc (b
, seqBytesDecoded
, env
);
5051 bytesDecoded
+= seqBytesDecoded
;
5052 if (elmtLen0
== INDEFINITE_LEN
)
5054 BDecEoc (b
, bytesDecoded
, env
);
5057 else if (seqBytesDecoded
!= elmtLen0
)
5059 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
5060 longjmp (env
, -155);
5064 } // CRLToSign::BDecContent
5066 AsnLen
CRLToSign::BEnc (BUF_TYPE b
)
5069 l
= BEncContent (b
);
5070 l
+= BEncConsLen (b
, l
);
5071 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5075 void CRLToSign::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
5080 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
5082 Asn1Error
<< "CRLToSign::BDec: ERROR - wrong tag" << endl
;
5083 longjmp (env
, -156);
5085 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
5086 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
5089 int CRLToSign::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
5091 bytesEncoded
= BEnc (b
);
5092 return !b
.WriteError();
5095 int CRLToSign::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
5101 if ((val
= setjmp (env
)) == 0)
5103 BDec (b
, bytesDecoded
, env
);
5104 return !b
.ReadError();
5110 void CRLToSign::Print (ostream
&os
) const
5113 os
<< "{ -- SEQUENCE --" << endl
;
5114 indentG
+= stdIndentG
;
5116 if (NOT_NULL (version
))
5118 Indent (os
, indentG
);
5124 Indent (os
, indentG
);
5130 if (NOT_NULL (signature
))
5132 Indent (os
, indentG
);
5138 Indent (os
, indentG
);
5144 if (NOT_NULL (issuer
))
5146 Indent (os
, indentG
);
5152 Indent (os
, indentG
);
5158 if (NOT_NULL (thisUpdate
))
5160 Indent (os
, indentG
);
5161 os
<< "thisUpdate ";
5166 Indent (os
, indentG
);
5167 os
<< "thisUpdate ";
5172 if (NOT_NULL (nextUpdate
))
5175 Indent (os
, indentG
);
5176 os
<< "nextUpdate ";
5181 Indent (os
, indentG
);
5182 os
<< "nextUpdate ";
5187 if (NOT_NULL (revokedCertificates
))
5190 Indent (os
, indentG
);
5191 os
<< "revokedCertificates ";
5192 os
<< *revokedCertificates
;
5196 Indent (os
, indentG
);
5197 os
<< "revokedCertificates ";
5202 if (NOT_NULL (crlExtensions
))
5205 Indent (os
, indentG
);
5206 os
<< "crlExtensions ";
5207 os
<< *crlExtensions
;
5211 Indent (os
, indentG
);
5212 os
<< "crlExtensions ";
5218 indentG
-= stdIndentG
;
5219 Indent (os
, indentG
);
5222 } // CRLToSign::Print
5225 AttributeCertificateInfo::AttributeCertificateInfo()
5229 subject
= new AttributeCertificateInfoChoice
;
5231 subject
= NULL
; // incomplete initialization of mandatory element!
5234 signature
= new AlgorithmIdentifier
;
5236 signature
= NULL
; // incomplete initialization of mandatory element!
5239 attCertValidityPeriod
= new AttCertValidityPeriod
;
5241 attCertValidityPeriod
= NULL
; // incomplete initialization of mandatory element!
5243 issuerUniqueID
= NULL
;
5247 AttributeCertificateInfo::AttributeCertificateInfo (const AttributeCertificateInfo
&)
5249 Asn1Error
<< "use of incompletely defined AttributeCertificateInfo::AttributeCertificateInfo (const AttributeCertificateInfo &)" << endl
;
5253 AttributeCertificateInfo::~AttributeCertificateInfo()
5258 delete attCertValidityPeriod
;
5259 delete issuerUniqueID
;
5263 AsnType
*AttributeCertificateInfo::Clone() const
5265 return new AttributeCertificateInfo
;
5268 AsnType
*AttributeCertificateInfo::Copy() const
5270 return new AttributeCertificateInfo (*this);
5274 AttributeCertificateInfo
&AttributeCertificateInfo::operator = (const AttributeCertificateInfo
&that
)
5275 #else // SNACC_DEEP_COPY
5276 AttributeCertificateInfo
&AttributeCertificateInfo::operator = (const AttributeCertificateInfo
&)
5277 #endif // SNACC_DEEP_COPY
5285 version
= new Version
;
5286 *version
= *that
.version
;
5296 subject
= new AttributeCertificateInfoChoice
;
5297 *subject
= *that
.subject
;
5304 issuer
= that
.issuer
;
5308 signature
= new AlgorithmIdentifier
;
5309 *signature
= *that
.signature
;
5316 serialNumber
= that
.serialNumber
;
5317 if (that
.attCertValidityPeriod
)
5319 if (!attCertValidityPeriod
)
5320 attCertValidityPeriod
= new AttCertValidityPeriod
;
5321 *attCertValidityPeriod
= *that
.attCertValidityPeriod
;
5325 delete attCertValidityPeriod
;
5326 attCertValidityPeriod
= NULL
;
5328 attributes
= that
.attributes
;
5329 if (that
.issuerUniqueID
)
5331 if (!issuerUniqueID
)
5332 issuerUniqueID
= new UniqueIdentifier
;
5333 *issuerUniqueID
= *that
.issuerUniqueID
;
5337 delete issuerUniqueID
;
5338 issuerUniqueID
= NULL
;
5340 if (that
.extensions
)
5343 extensions
= new Extensions
;
5344 *extensions
= *that
.extensions
;
5354 #else // SNACC_DEEP_COPY
5355 Asn1Error
<< "use of incompletely defined AttributeCertificateInfo &AttributeCertificateInfo::operator = (const AttributeCertificateInfo &)" << endl
;
5357 // if your compiler complains here, check the -novolat option
5358 #endif // SNACC_DEEP_COPY
5362 AttributeCertificateInfo::BEncContent (BUF_TYPE b
)
5364 AsnLen totalLen
= 0;
5367 if (NOT_NULL (extensions
))
5370 l
= extensions
->BEncContent (b
);
5371 l
+= BEncConsLen (b
, l
);
5373 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5377 if (NOT_NULL (issuerUniqueID
))
5379 l
= issuerUniqueID
->BEncContent (b
);
5380 l
+= BEncDefLen (b
, l
);
5382 l
+= BEncTag1 (b
, UNIV
, PRIM
, BITSTRING_TAG_CODE
);
5387 l
= attributes
.BEncContent (b
);
5388 l
+= BEncConsLen (b
, l
);
5390 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5394 l
= attCertValidityPeriod
->BEncContent (b
);
5395 l
+= BEncConsLen (b
, l
);
5397 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5400 l
= serialNumber
.BEncContent (b
);
5401 l
+= BEncDefLen (b
, l
);
5403 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
5407 l
= signature
->BEncContent (b
);
5408 l
+= BEncConsLen (b
, l
);
5410 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5414 l
= issuer
.BEncContent (b
);
5415 l
+= BEncConsLen (b
, l
);
5417 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5420 l
= subject
->BEncContent (b
);
5423 if (NOT_NULL (version
))
5425 l
= version
->BEncContent (b
);
5426 BEncDefLenTo127 (b
, l
);
5429 l
+= BEncTag1 (b
, UNIV
, PRIM
, INTEGER_TAG_CODE
);
5434 } // AttributeCertificateInfo::BEncContent
5437 void AttributeCertificateInfo::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
5440 AsnLen seqBytesDecoded
= 0;
5442 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5444 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
)))
5446 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5447 version
= new Version
;
5448 version
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5449 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5452 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0))
5453 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1)))
5455 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5456 subject
= new AttributeCertificateInfoChoice
;
5457 subject
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5458 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5462 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5463 longjmp (env
, -157);
5466 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5468 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5469 issuer
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5470 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5474 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5475 longjmp (env
, -158);
5478 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5480 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5481 signature
= new AlgorithmIdentifier
;
5482 signature
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5483 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5487 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5488 longjmp (env
, -159);
5491 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))
5492 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, INTEGER_TAG_CODE
)))
5494 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5495 serialNumber
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5496 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5500 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5501 longjmp (env
, -160);
5504 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5506 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5507 attCertValidityPeriod
= new AttCertValidityPeriod
;
5508 attCertValidityPeriod
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5509 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5513 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5514 longjmp (env
, -161);
5517 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5519 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5520 attributes
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5521 if (seqBytesDecoded
== elmtLen0
)
5523 bytesDecoded
+= seqBytesDecoded
;
5528 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5530 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
5532 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
5533 bytesDecoded
+= seqBytesDecoded
;
5540 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5541 longjmp (env
, -162);
5544 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BITSTRING_TAG_CODE
))
5545 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, BITSTRING_TAG_CODE
)))
5547 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5548 issuerUniqueID
= new UniqueIdentifier
;
5549 issuerUniqueID
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5550 if (seqBytesDecoded
== elmtLen0
)
5552 bytesDecoded
+= seqBytesDecoded
;
5557 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5559 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
5561 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
5562 bytesDecoded
+= seqBytesDecoded
;
5568 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5570 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5571 extensions
= new Extensions
;
5572 extensions
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5575 bytesDecoded
+= seqBytesDecoded
;
5576 if (elmtLen0
== INDEFINITE_LEN
)
5578 BDecEoc (b
, bytesDecoded
, env
);
5581 else if (seqBytesDecoded
!= elmtLen0
)
5583 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
5584 longjmp (env
, -163);
5588 } // AttributeCertificateInfo::BDecContent
5590 AsnLen
AttributeCertificateInfo::BEnc (BUF_TYPE b
)
5593 l
= BEncContent (b
);
5594 l
+= BEncConsLen (b
, l
);
5595 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5599 void AttributeCertificateInfo::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
5604 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
5606 Asn1Error
<< "AttributeCertificateInfo::BDec: ERROR - wrong tag" << endl
;
5607 longjmp (env
, -164);
5609 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
5610 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
5613 int AttributeCertificateInfo::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
5615 bytesEncoded
= BEnc (b
);
5616 return !b
.WriteError();
5619 int AttributeCertificateInfo::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
5625 if ((val
= setjmp (env
)) == 0)
5627 BDec (b
, bytesDecoded
, env
);
5628 return !b
.ReadError();
5634 void AttributeCertificateInfo::Print (ostream
&os
) const
5637 os
<< "{ -- SEQUENCE --" << endl
;
5638 indentG
+= stdIndentG
;
5640 if (NOT_NULL (version
))
5642 Indent (os
, indentG
);
5648 Indent (os
, indentG
);
5654 if (NOT_NULL (subject
))
5656 Indent (os
, indentG
);
5662 Indent (os
, indentG
);
5669 Indent (os
, indentG
);
5675 if (NOT_NULL (signature
))
5677 Indent (os
, indentG
);
5683 Indent (os
, indentG
);
5690 Indent (os
, indentG
);
5691 os
<< "serialNumber ";
5696 if (NOT_NULL (attCertValidityPeriod
))
5698 Indent (os
, indentG
);
5699 os
<< "attCertValidityPeriod ";
5700 os
<< *attCertValidityPeriod
;
5704 Indent (os
, indentG
);
5705 os
<< "attCertValidityPeriod ";
5711 Indent (os
, indentG
);
5712 os
<< "attributes ";
5717 if (NOT_NULL (issuerUniqueID
))
5720 Indent (os
, indentG
);
5721 os
<< "issuerUniqueID ";
5722 os
<< *issuerUniqueID
;
5726 Indent (os
, indentG
);
5727 os
<< "issuerUniqueID ";
5732 if (NOT_NULL (extensions
))
5735 Indent (os
, indentG
);
5736 os
<< "extensions ";
5741 Indent (os
, indentG
);
5742 os
<< "extensions ";
5748 indentG
-= stdIndentG
;
5749 Indent (os
, indentG
);
5752 } // AttributeCertificateInfo::Print
5755 Certificate::Certificate()
5758 certificateToSign
= new CertificateToSign
;
5760 certificateToSign
= NULL
; // incomplete initialization of mandatory element!
5763 algorithmIdentifier
= new AlgorithmIdentifier
;
5765 algorithmIdentifier
= NULL
; // incomplete initialization of mandatory element!
5769 Certificate::Certificate (const Certificate
&)
5771 Asn1Error
<< "use of incompletely defined Certificate::Certificate (const Certificate &)" << endl
;
5775 Certificate::~Certificate()
5777 delete certificateToSign
;
5778 delete algorithmIdentifier
;
5781 AsnType
*Certificate::Clone() const
5783 return new Certificate
;
5786 AsnType
*Certificate::Copy() const
5788 return new Certificate (*this);
5792 Certificate
&Certificate::operator = (const Certificate
&that
)
5793 #else // SNACC_DEEP_COPY
5794 Certificate
&Certificate::operator = (const Certificate
&)
5795 #endif // SNACC_DEEP_COPY
5800 if (that
.certificateToSign
)
5802 if (!certificateToSign
)
5803 certificateToSign
= new CertificateToSign
;
5804 *certificateToSign
= *that
.certificateToSign
;
5808 delete certificateToSign
;
5809 certificateToSign
= NULL
;
5811 if (that
.algorithmIdentifier
)
5813 if (!algorithmIdentifier
)
5814 algorithmIdentifier
= new AlgorithmIdentifier
;
5815 *algorithmIdentifier
= *that
.algorithmIdentifier
;
5819 delete algorithmIdentifier
;
5820 algorithmIdentifier
= NULL
;
5822 signatureValue
= that
.signatureValue
;
5826 #else // SNACC_DEEP_COPY
5827 Asn1Error
<< "use of incompletely defined Certificate &Certificate::operator = (const Certificate &)" << endl
;
5829 // if your compiler complains here, check the -novolat option
5830 #endif // SNACC_DEEP_COPY
5834 Certificate::BEncContent (BUF_TYPE b
)
5836 AsnLen totalLen
= 0;
5839 l
= signatureValue
.BEncContent (b
);
5840 l
+= BEncDefLen (b
, l
);
5842 l
+= BEncTag1 (b
, UNIV
, PRIM
, BITSTRING_TAG_CODE
);
5846 l
= algorithmIdentifier
->BEncContent (b
);
5847 l
+= BEncConsLen (b
, l
);
5849 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5853 l
= certificateToSign
->BEncContent (b
);
5854 l
+= BEncConsLen (b
, l
);
5856 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5860 } // Certificate::BEncContent
5863 void Certificate::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
5866 AsnLen seqBytesDecoded
= 0;
5868 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5870 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5872 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5873 certificateToSign
= new CertificateToSign
;
5874 certificateToSign
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5875 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5879 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5880 longjmp (env
, -165);
5883 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
5885 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5886 algorithmIdentifier
= new AlgorithmIdentifier
;
5887 algorithmIdentifier
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5888 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
5892 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5893 longjmp (env
, -166);
5896 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BITSTRING_TAG_CODE
))
5897 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, BITSTRING_TAG_CODE
)))
5899 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
5900 signatureValue
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
5904 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
5905 longjmp (env
, -167);
5908 bytesDecoded
+= seqBytesDecoded
;
5909 if (elmtLen0
== INDEFINITE_LEN
)
5911 BDecEoc (b
, bytesDecoded
, env
);
5914 else if (seqBytesDecoded
!= elmtLen0
)
5916 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
5917 longjmp (env
, -168);
5921 } // Certificate::BDecContent
5923 AsnLen
Certificate::BEnc (BUF_TYPE b
)
5926 l
= BEncContent (b
);
5927 l
+= BEncConsLen (b
, l
);
5928 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
5932 void Certificate::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
5937 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
5939 Asn1Error
<< "Certificate::BDec: ERROR - wrong tag" << endl
;
5940 longjmp (env
, -169);
5942 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
5943 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
5946 int Certificate::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
5948 bytesEncoded
= BEnc (b
);
5949 return !b
.WriteError();
5952 int Certificate::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
5958 if ((val
= setjmp (env
)) == 0)
5960 BDec (b
, bytesDecoded
, env
);
5961 return !b
.ReadError();
5967 void Certificate::Print (ostream
&os
) const
5970 os
<< "{ -- SEQUENCE --" << endl
;
5971 indentG
+= stdIndentG
;
5973 if (NOT_NULL (certificateToSign
))
5975 Indent (os
, indentG
);
5976 os
<< "certificateToSign ";
5977 os
<< *certificateToSign
;
5981 Indent (os
, indentG
);
5982 os
<< "certificateToSign ";
5987 if (NOT_NULL (algorithmIdentifier
))
5989 Indent (os
, indentG
);
5990 os
<< "algorithmIdentifier ";
5991 os
<< *algorithmIdentifier
;
5995 Indent (os
, indentG
);
5996 os
<< "algorithmIdentifier ";
6002 Indent (os
, indentG
);
6003 os
<< "signatureValue ";
6004 os
<< signatureValue
;
6008 indentG
-= stdIndentG
;
6009 Indent (os
, indentG
);
6012 } // Certificate::Print
6015 AsnType
*CrossCertificates::Clone() const
6017 return new CrossCertificates
;
6020 AsnType
*CrossCertificates::Copy() const
6022 return new CrossCertificates (*this);
6025 AsnLen
CrossCertificates::BEnc (BUF_TYPE b
)
6028 l
= BEncContent (b
);
6029 l
+= BEncConsLen (b
, l
);
6030 l
+= BEncTag1 (b
, UNIV
, CONS
, SET_TAG_CODE
);
6034 void CrossCertificates::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
6039 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SET_TAG_CODE
))
6041 Asn1Error
<< "CrossCertificates::BDec: ERROR - wrong tag" << endl
;
6042 longjmp (env
, -170);
6044 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
6045 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
6048 CrossCertificates::CrossCertificates (const CrossCertificates
&)
6050 Asn1Error
<< "use of incompletely defined CrossCertificates::CrossCertificates (const CrossCertificates &)" << endl
;
6054 CrossCertificates::~CrossCertificates()
6057 for (; Curr() != NULL
; RemoveCurrFromList())
6059 } // end of destructor
6062 CrossCertificates
&CrossCertificates::operator = (const CrossCertificates
&that
)
6063 #else // SNACC_DEEP_COPY
6064 CrossCertificates
&CrossCertificates::operator = (const CrossCertificates
&)
6065 #endif // SNACC_DEEP_COPY
6071 for (; Curr(); RemoveCurrFromList())
6074 //that.SetCurrToFirst();
6075 //for (; that.Curr(); that.GoNext())
6076 // AppendCopy (*that.Curr());
6077 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
6078 AppendCopy (*run
->elmt
);
6082 #else // SNACC_DEEP_COPY
6083 Asn1Error
<< "use of incompletely defined CrossCertificates &CrossCertificates::operator = (const CrossCertificates &)" << endl
;
6085 // if your compiler complains here, check the -novolat option
6086 #endif // SNACC_DEEP_COPY
6089 void CrossCertificates::Print (ostream
&os
) const
6092 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
6093 indentG
+= stdIndentG
;
6095 //for (; Curr() != NULL; GoNext())
6096 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
6098 Indent (os
, indentG
);
6101 //if (Curr() != Last())
6106 indentG
-= stdIndentG
;
6107 Indent (os
, indentG
);
6115 void CrossCertificates::SetCurrElmt (unsigned long int index
)
6117 unsigned long int i
;
6120 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
6122 } // CrossCertificates::SetCurrElmt
6125 unsigned long int CrossCertificates::GetCurrElmtIndex()
6127 unsigned long int i
;
6131 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
6140 } // CrossCertificates::GetCurrElmtIndex
6143 // alloc new list elmt, put at end of list
6144 // and return the component type
6145 Certificate
*CrossCertificates::Append()
6147 AsnListElmt
*newElmt
;
6148 newElmt
= new AsnListElmt
;
6149 newElmt
->elmt
= new Certificate
;
6150 newElmt
->next
= NULL
;
6153 newElmt
->prev
= NULL
;
6154 first
= last
= newElmt
;
6158 newElmt
->prev
= last
;
6159 last
->next
= newElmt
;
6163 return (curr
= newElmt
)->elmt
;
6164 } // CrossCertificates::Append
6167 // alloc new list elmt, put at begining of list
6168 // and return the component type
6169 Certificate
*CrossCertificates::Prepend()
6171 AsnListElmt
*newElmt
;
6172 newElmt
= new AsnListElmt
;
6173 newElmt
->elmt
= new Certificate
;
6174 newElmt
->prev
= NULL
;
6177 newElmt
->next
= NULL
;
6178 first
= last
= newElmt
;
6182 newElmt
->next
= first
;
6183 first
->prev
= newElmt
;
6187 return (curr
= newElmt
)->elmt
;
6188 } // CrossCertificates::Prepend
6191 // alloc new list elmt, insert it before the
6192 // current element and return the component type
6193 // if the current element is null, the new element
6194 // is placed at the beginning of the list.
6195 Certificate
*CrossCertificates::InsertBefore()
6197 AsnListElmt
*newElmt
;
6198 newElmt
= new AsnListElmt
;
6199 newElmt
->elmt
= new Certificate
;
6202 newElmt
->next
= first
;
6203 newElmt
->prev
= NULL
;
6210 newElmt
->next
= curr
;
6211 newElmt
->prev
= curr
->prev
;
6212 curr
->prev
= newElmt
;
6216 newElmt
->prev
->next
= newElmt
;
6219 return (curr
= newElmt
)->elmt
;
6220 } // CrossCertificates::InsertBefore
6223 // alloc new list elmt, insert it after the
6224 // current element and return the component type
6225 // if the current element is null, the new element
6226 // is placed at the end of the list.
6227 Certificate
*CrossCertificates::InsertAfter()
6229 AsnListElmt
*newElmt
;
6230 newElmt
= new AsnListElmt
;
6231 newElmt
->elmt
= new Certificate
;
6234 newElmt
->prev
= last
;
6235 newElmt
->next
= NULL
;
6242 newElmt
->prev
= curr
;
6243 newElmt
->next
= curr
->next
;
6244 curr
->next
= newElmt
;
6248 newElmt
->next
->prev
= newElmt
;
6251 return (curr
= newElmt
)->elmt
;
6252 } // CrossCertificates::InsertAfter
6255 CrossCertificates
&CrossCertificates::AppendCopy (Certificate
&elmt
)
6257 AsnListElmt
*newElmt
;
6258 newElmt
= new AsnListElmt
;
6259 newElmt
->elmt
= new Certificate
;
6260 *newElmt
->elmt
= elmt
;
6261 newElmt
->next
= NULL
;
6264 newElmt
->prev
= NULL
;
6265 first
= last
= newElmt
;
6269 newElmt
->prev
= last
;
6270 last
->next
= newElmt
;
6278 CrossCertificates
&CrossCertificates::PrependCopy (Certificate
&elmt
)
6280 AsnListElmt
*newElmt
;
6281 newElmt
= new AsnListElmt
;
6282 newElmt
->elmt
= new Certificate
;
6283 *newElmt
->elmt
= elmt
;
6284 newElmt
->prev
= NULL
;
6287 newElmt
->next
= NULL
;
6288 first
= last
= newElmt
;
6292 newElmt
->next
= first
;
6293 first
->prev
= newElmt
;
6298 } // CrossCertificates::PrependCopy
6301 // alloc new list elmt, insert it before the
6302 // current element, copy the given elmt into the new elmt
6303 // and return the component type.
6304 // if the current element is null, the new element
6305 // is placed at the beginning of the list.
6306 CrossCertificates
&CrossCertificates::InsertBeforeAndCopy (Certificate
&elmt
)
6308 AsnListElmt
*newElmt
;
6310 newElmt
= new AsnListElmt
;
6311 newElmt
->elmt
= new Certificate
;
6312 *newElmt
->elmt
= elmt
;
6316 newElmt
->next
= first
;
6317 newElmt
->prev
= NULL
;
6324 newElmt
->next
= curr
;
6325 newElmt
->prev
= curr
->prev
;
6326 curr
->prev
= newElmt
;
6330 newElmt
->prev
->next
= newElmt
;
6334 } // CrossCertificates::InsertBeforeAndCopy
6337 // alloc new list elmt, insert it after the
6338 // current element, copy given elmt in to new elmt
6339 // and return the component type
6340 // if the current element is null, the new element
6341 // is placed at the end of the list.
6342 CrossCertificates
&CrossCertificates::InsertAfterAndCopy (Certificate
&elmt
)
6344 AsnListElmt
*newElmt
;
6346 newElmt
= new AsnListElmt
;
6347 newElmt
->elmt
= new Certificate
;
6348 *newElmt
->elmt
= elmt
;
6351 newElmt
->prev
= last
;
6352 newElmt
->next
= NULL
;
6359 newElmt
->prev
= curr
;
6360 newElmt
->next
= curr
->next
;
6361 curr
->next
= newElmt
;
6365 newElmt
->next
->prev
= newElmt
;
6369 } // CrossCertificates::InsertAfterAndCopy
6372 // remove current element from list if current element is not NULL
6373 // The new current element will be the next element.
6374 // If the current element is the last element in the list
6375 // the second but last element will become the new current element.
6376 void CrossCertificates::RemoveCurrFromList()
6378 AsnListElmt
*del_elmt
;
6386 first
= last
= curr
= NULL
;
6387 else if (curr
== first
)
6389 curr
= first
= first
->next
;
6392 else if (curr
== last
)
6394 curr
= last
= last
->prev
;
6399 curr
->prev
->next
= curr
->next
;
6400 curr
->next
->prev
= curr
->prev
;
6403 delete del_elmt
->elmt
;
6409 AsnLen
CrossCertificates::BEncContent (BUF_TYPE b
)
6411 AsnListElmt
*currElmt
;
6413 AsnLen totalLen
= 0;
6416 CSM_Buffer
**tmpEnc
=NULL
;
6417 for (currElmt
= last
,icount
=0; currElmt
!= NULL
; currElmt
= currElmt
->prev
, icount
++);
6418 tmpEnc
= (CSM_Buffer
**) calloc(sizeof(CSM_Buffer
*), icount
);
6419 for (currElmt
= last
, iii
=0; currElmt
!= NULL
; currElmt
= currElmt
->prev
,iii
++,elmtLen
=0)
6422 ENCODE_BUF1(currElmt
->elmt
->BEncContent
, elmtLen
);
6423 elmtLen
+= BEncConsLen (outputBuf
, elmtLen
);
6425 elmtLen
+= BEncTag1 (outputBuf
, UNIV
, CONS
, SEQ_TAG_CODE
);
6426 ENCODE_BUF2(tmpEnc
[iii
]);
6428 vdasnacc_sortSetOf(tmpEnc
, icount
);
6429 for (iii
=0,elmtLen
=0; iii
< icount
; elmtLen
+=tmpEnc
[iii
++]->Length())
6430 SM_WriteToAsnBuf(tmpEnc
[iii
], b
);
6431 for (iii
=0; iii
< icount
; iii
++) delete tmpEnc
[iii
];
6434 totalLen
+= elmtLen
;
6436 } // CrossCertificates::BEncContent
6439 void CrossCertificates::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
6440 AsnLen
&bytesDecoded
, ENV_TYPE env
)
6442 Certificate
*listElmt
;
6444 AsnLen listBytesDecoded
= 0;
6447 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
6449 tag1
= BDecTag (b
, listBytesDecoded
, env
);
6450 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
6452 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
6455 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
6457 Asn1Error
<< "Unexpected Tag" << endl
;
6458 longjmp (env
, -171);
6461 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
6462 listElmt
= Append();
6463 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
6466 bytesDecoded
+= listBytesDecoded
;
6467 } // CrossCertificates::BDecContent
6470 CertificatePair::CertificatePair()
6476 CertificatePair::CertificatePair (const CertificatePair
&)
6478 Asn1Error
<< "use of incompletely defined CertificatePair::CertificatePair (const CertificatePair &)" << endl
;
6482 CertificatePair::~CertificatePair()
6488 AsnType
*CertificatePair::Clone() const
6490 return new CertificatePair
;
6493 AsnType
*CertificatePair::Copy() const
6495 return new CertificatePair (*this);
6499 CertificatePair
&CertificatePair::operator = (const CertificatePair
&that
)
6500 #else // SNACC_DEEP_COPY
6501 CertificatePair
&CertificatePair::operator = (const CertificatePair
&)
6502 #endif // SNACC_DEEP_COPY
6510 forward
= new Certificate
;
6511 *forward
= *that
.forward
;
6521 reverse
= new Certificate
;
6522 *reverse
= *that
.reverse
;
6532 #else // SNACC_DEEP_COPY
6533 Asn1Error
<< "use of incompletely defined CertificatePair &CertificatePair::operator = (const CertificatePair &)" << endl
;
6535 // if your compiler complains here, check the -novolat option
6536 #endif // SNACC_DEEP_COPY
6540 CertificatePair::BEncContent (BUF_TYPE b
)
6542 AsnLen totalLen
= 0;
6545 if (NOT_NULL (reverse
))
6549 l
= reverse
->BEncContent (b
);
6550 l
+= BEncConsLen (b
, l
);
6552 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
6553 l
+= BEncConsLen (b
, l
);
6555 l
+= BEncTag1 (b
, CNTX
, CONS
, 1);
6559 if (NOT_NULL (forward
))
6563 l
= forward
->BEncContent (b
);
6564 l
+= BEncConsLen (b
, l
);
6566 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
6567 l
+= BEncConsLen (b
, l
);
6569 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
6574 } // CertificatePair::BEncContent
6577 void CertificatePair::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
6580 AsnLen seqBytesDecoded
= 0;
6587 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6589 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
6591 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
6592 bytesDecoded
+= seqBytesDecoded
;
6597 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0)))
6599 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
6600 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6602 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
6604 Asn1Error
<< "Unexpected Tag" << endl
;
6605 longjmp (env
, -172);
6608 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
6609 forward
= new Certificate
;
6610 forward
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
6611 if (elmtLen1
== INDEFINITE_LEN
)
6612 BDecEoc (b
, seqBytesDecoded
, env
);
6614 if (seqBytesDecoded
== elmtLen0
)
6616 bytesDecoded
+= seqBytesDecoded
;
6621 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6623 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
6625 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
6626 bytesDecoded
+= seqBytesDecoded
;
6632 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1)))
6634 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
6635 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6637 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
6639 Asn1Error
<< "Unexpected Tag" << endl
;
6640 longjmp (env
, -173);
6643 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
6644 reverse
= new Certificate
;
6645 reverse
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
6646 if (elmtLen1
== INDEFINITE_LEN
)
6647 BDecEoc (b
, seqBytesDecoded
, env
);
6651 bytesDecoded
+= seqBytesDecoded
;
6652 if (elmtLen0
== INDEFINITE_LEN
)
6654 BDecEoc (b
, bytesDecoded
, env
);
6657 else if (seqBytesDecoded
!= elmtLen0
)
6659 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
6660 longjmp (env
, -174);
6664 } // CertificatePair::BDecContent
6666 AsnLen
CertificatePair::BEnc (BUF_TYPE b
)
6669 l
= BEncContent (b
);
6670 l
+= BEncConsLen (b
, l
);
6671 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
6675 void CertificatePair::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
6680 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
6682 Asn1Error
<< "CertificatePair::BDec: ERROR - wrong tag" << endl
;
6683 longjmp (env
, -175);
6685 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
6686 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
6689 int CertificatePair::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
6691 bytesEncoded
= BEnc (b
);
6692 return !b
.WriteError();
6695 int CertificatePair::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
6701 if ((val
= setjmp (env
)) == 0)
6703 BDec (b
, bytesDecoded
, env
);
6704 return !b
.ReadError();
6710 void CertificatePair::Print (ostream
&os
) const
6713 int nonePrinted
= true;
6714 os
<< "{ -- SEQUENCE --" << endl
;
6715 indentG
+= stdIndentG
;
6717 if (NOT_NULL (forward
))
6719 nonePrinted
= false;
6720 Indent (os
, indentG
);
6726 Indent (os
, indentG
);
6732 if (NOT_NULL (reverse
))
6736 nonePrinted
= false;
6737 Indent (os
, indentG
);
6743 Indent (os
, indentG
);
6750 indentG
-= stdIndentG
;
6751 Indent (os
, indentG
);
6754 } // CertificatePair::Print
6757 CertificateList::CertificateList()
6760 crlToSign
= new CRLToSign
;
6762 crlToSign
= NULL
; // incomplete initialization of mandatory element!
6765 algorithmIdentifier
= new AlgorithmIdentifier
;
6767 algorithmIdentifier
= NULL
; // incomplete initialization of mandatory element!
6771 CertificateList::CertificateList (const CertificateList
&)
6773 Asn1Error
<< "use of incompletely defined CertificateList::CertificateList (const CertificateList &)" << endl
;
6777 CertificateList::~CertificateList()
6780 delete algorithmIdentifier
;
6783 AsnType
*CertificateList::Clone() const
6785 return new CertificateList
;
6788 AsnType
*CertificateList::Copy() const
6790 return new CertificateList (*this);
6794 CertificateList
&CertificateList::operator = (const CertificateList
&that
)
6795 #else // SNACC_DEEP_COPY
6796 CertificateList
&CertificateList::operator = (const CertificateList
&)
6797 #endif // SNACC_DEEP_COPY
6805 crlToSign
= new CRLToSign
;
6806 *crlToSign
= *that
.crlToSign
;
6813 if (that
.algorithmIdentifier
)
6815 if (!algorithmIdentifier
)
6816 algorithmIdentifier
= new AlgorithmIdentifier
;
6817 *algorithmIdentifier
= *that
.algorithmIdentifier
;
6821 delete algorithmIdentifier
;
6822 algorithmIdentifier
= NULL
;
6824 signatureValue
= that
.signatureValue
;
6828 #else // SNACC_DEEP_COPY
6829 Asn1Error
<< "use of incompletely defined CertificateList &CertificateList::operator = (const CertificateList &)" << endl
;
6831 // if your compiler complains here, check the -novolat option
6832 #endif // SNACC_DEEP_COPY
6836 CertificateList::BEncContent (BUF_TYPE b
)
6838 AsnLen totalLen
= 0;
6841 l
= signatureValue
.BEncContent (b
);
6842 l
+= BEncDefLen (b
, l
);
6844 l
+= BEncTag1 (b
, UNIV
, PRIM
, BITSTRING_TAG_CODE
);
6848 l
= algorithmIdentifier
->BEncContent (b
);
6849 l
+= BEncConsLen (b
, l
);
6851 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
6855 l
= crlToSign
->BEncContent (b
);
6856 l
+= BEncConsLen (b
, l
);
6858 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
6862 } // CertificateList::BEncContent
6865 void CertificateList::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
6868 AsnLen seqBytesDecoded
= 0;
6870 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6872 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
6874 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
6875 crlToSign
= new CRLToSign
;
6876 crlToSign
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
6877 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6881 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
6882 longjmp (env
, -176);
6885 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
6887 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
6888 algorithmIdentifier
= new AlgorithmIdentifier
;
6889 algorithmIdentifier
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
6890 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
6894 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
6895 longjmp (env
, -177);
6898 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BITSTRING_TAG_CODE
))
6899 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, BITSTRING_TAG_CODE
)))
6901 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
6902 signatureValue
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
6906 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
6907 longjmp (env
, -178);
6910 bytesDecoded
+= seqBytesDecoded
;
6911 if (elmtLen0
== INDEFINITE_LEN
)
6913 BDecEoc (b
, bytesDecoded
, env
);
6916 else if (seqBytesDecoded
!= elmtLen0
)
6918 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
6919 longjmp (env
, -179);
6923 } // CertificateList::BDecContent
6925 AsnLen
CertificateList::BEnc (BUF_TYPE b
)
6928 l
= BEncContent (b
);
6929 l
+= BEncConsLen (b
, l
);
6930 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
6934 void CertificateList::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
6939 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
6941 Asn1Error
<< "CertificateList::BDec: ERROR - wrong tag" << endl
;
6942 longjmp (env
, -180);
6944 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
6945 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
6948 int CertificateList::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
6950 bytesEncoded
= BEnc (b
);
6951 return !b
.WriteError();
6954 int CertificateList::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
6960 if ((val
= setjmp (env
)) == 0)
6962 BDec (b
, bytesDecoded
, env
);
6963 return !b
.ReadError();
6969 void CertificateList::Print (ostream
&os
) const
6972 os
<< "{ -- SEQUENCE --" << endl
;
6973 indentG
+= stdIndentG
;
6975 if (NOT_NULL (crlToSign
))
6977 Indent (os
, indentG
);
6983 Indent (os
, indentG
);
6989 if (NOT_NULL (algorithmIdentifier
))
6991 Indent (os
, indentG
);
6992 os
<< "algorithmIdentifier ";
6993 os
<< *algorithmIdentifier
;
6997 Indent (os
, indentG
);
6998 os
<< "algorithmIdentifier ";
7004 Indent (os
, indentG
);
7005 os
<< "signatureValue ";
7006 os
<< signatureValue
;
7010 indentG
-= stdIndentG
;
7011 Indent (os
, indentG
);
7014 } // CertificateList::Print
7017 AttributeCertificate::AttributeCertificate()
7020 attributeCertificateInfo
= new AttributeCertificateInfo
;
7022 attributeCertificateInfo
= NULL
; // incomplete initialization of mandatory element!
7025 algorithmIdentifier
= new AlgorithmIdentifier
;
7027 algorithmIdentifier
= NULL
; // incomplete initialization of mandatory element!
7031 AttributeCertificate::AttributeCertificate (const AttributeCertificate
&)
7033 Asn1Error
<< "use of incompletely defined AttributeCertificate::AttributeCertificate (const AttributeCertificate &)" << endl
;
7037 AttributeCertificate::~AttributeCertificate()
7039 delete attributeCertificateInfo
;
7040 delete algorithmIdentifier
;
7043 AsnType
*AttributeCertificate::Clone() const
7045 return new AttributeCertificate
;
7048 AsnType
*AttributeCertificate::Copy() const
7050 return new AttributeCertificate (*this);
7054 AttributeCertificate
&AttributeCertificate::operator = (const AttributeCertificate
&that
)
7055 #else // SNACC_DEEP_COPY
7056 AttributeCertificate
&AttributeCertificate::operator = (const AttributeCertificate
&)
7057 #endif // SNACC_DEEP_COPY
7062 if (that
.attributeCertificateInfo
)
7064 if (!attributeCertificateInfo
)
7065 attributeCertificateInfo
= new AttributeCertificateInfo
;
7066 *attributeCertificateInfo
= *that
.attributeCertificateInfo
;
7070 delete attributeCertificateInfo
;
7071 attributeCertificateInfo
= NULL
;
7073 if (that
.algorithmIdentifier
)
7075 if (!algorithmIdentifier
)
7076 algorithmIdentifier
= new AlgorithmIdentifier
;
7077 *algorithmIdentifier
= *that
.algorithmIdentifier
;
7081 delete algorithmIdentifier
;
7082 algorithmIdentifier
= NULL
;
7084 signatureValue
= that
.signatureValue
;
7088 #else // SNACC_DEEP_COPY
7089 Asn1Error
<< "use of incompletely defined AttributeCertificate &AttributeCertificate::operator = (const AttributeCertificate &)" << endl
;
7091 // if your compiler complains here, check the -novolat option
7092 #endif // SNACC_DEEP_COPY
7096 AttributeCertificate::BEncContent (BUF_TYPE b
)
7098 AsnLen totalLen
= 0;
7101 l
= signatureValue
.BEncContent (b
);
7102 l
+= BEncDefLen (b
, l
);
7104 l
+= BEncTag1 (b
, UNIV
, PRIM
, BITSTRING_TAG_CODE
);
7108 l
= algorithmIdentifier
->BEncContent (b
);
7109 l
+= BEncConsLen (b
, l
);
7111 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
7115 l
= attributeCertificateInfo
->BEncContent (b
);
7116 l
+= BEncConsLen (b
, l
);
7118 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
7122 } // AttributeCertificate::BEncContent
7125 void AttributeCertificate::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
7128 AsnLen seqBytesDecoded
= 0;
7130 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
7132 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
7134 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
7135 attributeCertificateInfo
= new AttributeCertificateInfo
;
7136 attributeCertificateInfo
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
7137 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
7141 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
7142 longjmp (env
, -181);
7145 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
7147 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
7148 algorithmIdentifier
= new AlgorithmIdentifier
;
7149 algorithmIdentifier
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
7150 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
7154 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
7155 longjmp (env
, -182);
7158 if ((tag1
== MAKE_TAG_ID (UNIV
, PRIM
, BITSTRING_TAG_CODE
))
7159 || (tag1
== MAKE_TAG_ID (UNIV
, CONS
, BITSTRING_TAG_CODE
)))
7161 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
7162 signatureValue
.BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
7166 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
7167 longjmp (env
, -183);
7170 bytesDecoded
+= seqBytesDecoded
;
7171 if (elmtLen0
== INDEFINITE_LEN
)
7173 BDecEoc (b
, bytesDecoded
, env
);
7176 else if (seqBytesDecoded
!= elmtLen0
)
7178 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
7179 longjmp (env
, -184);
7183 } // AttributeCertificate::BDecContent
7185 AsnLen
AttributeCertificate::BEnc (BUF_TYPE b
)
7188 l
= BEncContent (b
);
7189 l
+= BEncConsLen (b
, l
);
7190 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
7194 void AttributeCertificate::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
7199 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
7201 Asn1Error
<< "AttributeCertificate::BDec: ERROR - wrong tag" << endl
;
7202 longjmp (env
, -185);
7204 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
7205 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
7208 int AttributeCertificate::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
7210 bytesEncoded
= BEnc (b
);
7211 return !b
.WriteError();
7214 int AttributeCertificate::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
7220 if ((val
= setjmp (env
)) == 0)
7222 BDec (b
, bytesDecoded
, env
);
7223 return !b
.ReadError();
7229 void AttributeCertificate::Print (ostream
&os
) const
7232 os
<< "{ -- SEQUENCE --" << endl
;
7233 indentG
+= stdIndentG
;
7235 if (NOT_NULL (attributeCertificateInfo
))
7237 Indent (os
, indentG
);
7238 os
<< "attributeCertificateInfo ";
7239 os
<< *attributeCertificateInfo
;
7243 Indent (os
, indentG
);
7244 os
<< "attributeCertificateInfo ";
7249 if (NOT_NULL (algorithmIdentifier
))
7251 Indent (os
, indentG
);
7252 os
<< "algorithmIdentifier ";
7253 os
<< *algorithmIdentifier
;
7257 Indent (os
, indentG
);
7258 os
<< "algorithmIdentifier ";
7264 Indent (os
, indentG
);
7265 os
<< "signatureValue ";
7266 os
<< signatureValue
;
7270 indentG
-= stdIndentG
;
7271 Indent (os
, indentG
);
7274 } // AttributeCertificate::Print
7277 AsnType
*CertificationPathSeqOf::Clone() const
7279 return new CertificationPathSeqOf
;
7282 AsnType
*CertificationPathSeqOf::Copy() const
7284 return new CertificationPathSeqOf (*this);
7287 AsnLen
CertificationPathSeqOf::BEnc (BUF_TYPE b
)
7290 l
= BEncContent (b
);
7291 l
+= BEncConsLen (b
, l
);
7292 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
7296 void CertificationPathSeqOf::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
7301 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
7303 Asn1Error
<< "CertificationPathSeqOf::BDec: ERROR - wrong tag" << endl
;
7304 longjmp (env
, -186);
7306 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
7307 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
7310 CertificationPathSeqOf::CertificationPathSeqOf (const CertificationPathSeqOf
&)
7312 Asn1Error
<< "use of incompletely defined CertificationPathSeqOf::CertificationPathSeqOf (const CertificationPathSeqOf &)" << endl
;
7316 CertificationPathSeqOf::~CertificationPathSeqOf()
7319 for (; Curr() != NULL
; RemoveCurrFromList())
7321 } // end of destructor
7324 CertificationPathSeqOf
&CertificationPathSeqOf::operator = (const CertificationPathSeqOf
&that
)
7325 #else // SNACC_DEEP_COPY
7326 CertificationPathSeqOf
&CertificationPathSeqOf::operator = (const CertificationPathSeqOf
&)
7327 #endif // SNACC_DEEP_COPY
7333 for (; Curr(); RemoveCurrFromList())
7336 //that.SetCurrToFirst();
7337 //for (; that.Curr(); that.GoNext())
7338 // AppendCopy (*that.Curr());
7339 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
7340 AppendCopy (*run
->elmt
);
7344 #else // SNACC_DEEP_COPY
7345 Asn1Error
<< "use of incompletely defined CertificationPathSeqOf &CertificationPathSeqOf::operator = (const CertificationPathSeqOf &)" << endl
;
7347 // if your compiler complains here, check the -novolat option
7348 #endif // SNACC_DEEP_COPY
7351 void CertificationPathSeqOf::Print (ostream
&os
) const
7354 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
7355 indentG
+= stdIndentG
;
7357 //for (; Curr() != NULL; GoNext())
7358 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
7360 Indent (os
, indentG
);
7363 //if (Curr() != Last())
7368 indentG
-= stdIndentG
;
7369 Indent (os
, indentG
);
7377 void CertificationPathSeqOf::SetCurrElmt (unsigned long int index
)
7379 unsigned long int i
;
7382 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
7384 } // CertificationPathSeqOf::SetCurrElmt
7387 unsigned long int CertificationPathSeqOf::GetCurrElmtIndex()
7389 unsigned long int i
;
7393 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
7402 } // CertificationPathSeqOf::GetCurrElmtIndex
7405 // alloc new list elmt, put at end of list
7406 // and return the component type
7407 CertificatePair
*CertificationPathSeqOf::Append()
7409 AsnListElmt
*newElmt
;
7410 newElmt
= new AsnListElmt
;
7411 newElmt
->elmt
= new CertificatePair
;
7412 newElmt
->next
= NULL
;
7415 newElmt
->prev
= NULL
;
7416 first
= last
= newElmt
;
7420 newElmt
->prev
= last
;
7421 last
->next
= newElmt
;
7425 return (curr
= newElmt
)->elmt
;
7426 } // CertificationPathSeqOf::Append
7429 // alloc new list elmt, put at begining of list
7430 // and return the component type
7431 CertificatePair
*CertificationPathSeqOf::Prepend()
7433 AsnListElmt
*newElmt
;
7434 newElmt
= new AsnListElmt
;
7435 newElmt
->elmt
= new CertificatePair
;
7436 newElmt
->prev
= NULL
;
7439 newElmt
->next
= NULL
;
7440 first
= last
= newElmt
;
7444 newElmt
->next
= first
;
7445 first
->prev
= newElmt
;
7449 return (curr
= newElmt
)->elmt
;
7450 } // CertificationPathSeqOf::Prepend
7453 // alloc new list elmt, insert it before the
7454 // current element and return the component type
7455 // if the current element is null, the new element
7456 // is placed at the beginning of the list.
7457 CertificatePair
*CertificationPathSeqOf::InsertBefore()
7459 AsnListElmt
*newElmt
;
7460 newElmt
= new AsnListElmt
;
7461 newElmt
->elmt
= new CertificatePair
;
7464 newElmt
->next
= first
;
7465 newElmt
->prev
= NULL
;
7472 newElmt
->next
= curr
;
7473 newElmt
->prev
= curr
->prev
;
7474 curr
->prev
= newElmt
;
7478 newElmt
->prev
->next
= newElmt
;
7481 return (curr
= newElmt
)->elmt
;
7482 } // CertificationPathSeqOf::InsertBefore
7485 // alloc new list elmt, insert it after the
7486 // current element and return the component type
7487 // if the current element is null, the new element
7488 // is placed at the end of the list.
7489 CertificatePair
*CertificationPathSeqOf::InsertAfter()
7491 AsnListElmt
*newElmt
;
7492 newElmt
= new AsnListElmt
;
7493 newElmt
->elmt
= new CertificatePair
;
7496 newElmt
->prev
= last
;
7497 newElmt
->next
= NULL
;
7504 newElmt
->prev
= curr
;
7505 newElmt
->next
= curr
->next
;
7506 curr
->next
= newElmt
;
7510 newElmt
->next
->prev
= newElmt
;
7513 return (curr
= newElmt
)->elmt
;
7514 } // CertificationPathSeqOf::InsertAfter
7517 CertificationPathSeqOf
&CertificationPathSeqOf::AppendCopy (CertificatePair
&elmt
)
7519 AsnListElmt
*newElmt
;
7520 newElmt
= new AsnListElmt
;
7521 newElmt
->elmt
= new CertificatePair
;
7522 *newElmt
->elmt
= elmt
;
7523 newElmt
->next
= NULL
;
7526 newElmt
->prev
= NULL
;
7527 first
= last
= newElmt
;
7531 newElmt
->prev
= last
;
7532 last
->next
= newElmt
;
7540 CertificationPathSeqOf
&CertificationPathSeqOf::PrependCopy (CertificatePair
&elmt
)
7542 AsnListElmt
*newElmt
;
7543 newElmt
= new AsnListElmt
;
7544 newElmt
->elmt
= new CertificatePair
;
7545 *newElmt
->elmt
= elmt
;
7546 newElmt
->prev
= NULL
;
7549 newElmt
->next
= NULL
;
7550 first
= last
= newElmt
;
7554 newElmt
->next
= first
;
7555 first
->prev
= newElmt
;
7560 } // CertificationPathSeqOf::PrependCopy
7563 // alloc new list elmt, insert it before the
7564 // current element, copy the given elmt into the new elmt
7565 // and return the component type.
7566 // if the current element is null, the new element
7567 // is placed at the beginning of the list.
7568 CertificationPathSeqOf
&CertificationPathSeqOf::InsertBeforeAndCopy (CertificatePair
&elmt
)
7570 AsnListElmt
*newElmt
;
7572 newElmt
= new AsnListElmt
;
7573 newElmt
->elmt
= new CertificatePair
;
7574 *newElmt
->elmt
= elmt
;
7578 newElmt
->next
= first
;
7579 newElmt
->prev
= NULL
;
7586 newElmt
->next
= curr
;
7587 newElmt
->prev
= curr
->prev
;
7588 curr
->prev
= newElmt
;
7592 newElmt
->prev
->next
= newElmt
;
7596 } // CertificationPathSeqOf::InsertBeforeAndCopy
7599 // alloc new list elmt, insert it after the
7600 // current element, copy given elmt in to new elmt
7601 // and return the component type
7602 // if the current element is null, the new element
7603 // is placed at the end of the list.
7604 CertificationPathSeqOf
&CertificationPathSeqOf::InsertAfterAndCopy (CertificatePair
&elmt
)
7606 AsnListElmt
*newElmt
;
7608 newElmt
= new AsnListElmt
;
7609 newElmt
->elmt
= new CertificatePair
;
7610 *newElmt
->elmt
= elmt
;
7613 newElmt
->prev
= last
;
7614 newElmt
->next
= NULL
;
7621 newElmt
->prev
= curr
;
7622 newElmt
->next
= curr
->next
;
7623 curr
->next
= newElmt
;
7627 newElmt
->next
->prev
= newElmt
;
7631 } // CertificationPathSeqOf::InsertAfterAndCopy
7634 // remove current element from list if current element is not NULL
7635 // The new current element will be the next element.
7636 // If the current element is the last element in the list
7637 // the second but last element will become the new current element.
7638 void CertificationPathSeqOf::RemoveCurrFromList()
7640 AsnListElmt
*del_elmt
;
7648 first
= last
= curr
= NULL
;
7649 else if (curr
== first
)
7651 curr
= first
= first
->next
;
7654 else if (curr
== last
)
7656 curr
= last
= last
->prev
;
7661 curr
->prev
->next
= curr
->next
;
7662 curr
->next
->prev
= curr
->prev
;
7665 delete del_elmt
->elmt
;
7671 AsnLen
CertificationPathSeqOf::BEncContent (BUF_TYPE b
)
7673 AsnListElmt
*currElmt
;
7675 AsnLen totalLen
= 0;
7676 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
7679 elmtLen
= currElmt
->elmt
->BEncContent (b
);
7680 elmtLen
+= BEncConsLen (b
, elmtLen
);
7682 elmtLen
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
7683 totalLen
+= elmtLen
;
7686 } // CertificationPathSeqOf::BEncContent
7689 void CertificationPathSeqOf::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
7690 AsnLen
&bytesDecoded
, ENV_TYPE env
)
7692 CertificatePair
*listElmt
;
7694 AsnLen listBytesDecoded
= 0;
7697 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
7699 tag1
= BDecTag (b
, listBytesDecoded
, env
);
7700 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
7702 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
7705 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
7707 Asn1Error
<< "Unexpected Tag" << endl
;
7708 longjmp (env
, -187);
7711 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
7712 listElmt
= Append();
7713 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
7716 bytesDecoded
+= listBytesDecoded
;
7717 } // CertificationPathSeqOf::BDecContent
7720 AsnType
*ForwardCertificationPath::Clone() const
7722 return new ForwardCertificationPath
;
7725 AsnType
*ForwardCertificationPath::Copy() const
7727 return new ForwardCertificationPath (*this);
7730 AsnLen
ForwardCertificationPath::BEnc (BUF_TYPE b
)
7733 l
= BEncContent (b
);
7734 l
+= BEncConsLen (b
, l
);
7735 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
7739 void ForwardCertificationPath::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
7744 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
7746 Asn1Error
<< "ForwardCertificationPath::BDec: ERROR - wrong tag" << endl
;
7747 longjmp (env
, -188);
7749 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
7750 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
7753 ForwardCertificationPath::ForwardCertificationPath (const ForwardCertificationPath
&)
7755 Asn1Error
<< "use of incompletely defined ForwardCertificationPath::ForwardCertificationPath (const ForwardCertificationPath &)" << endl
;
7759 ForwardCertificationPath::~ForwardCertificationPath()
7762 for (; Curr() != NULL
; RemoveCurrFromList())
7764 } // end of destructor
7767 ForwardCertificationPath
&ForwardCertificationPath::operator = (const ForwardCertificationPath
&that
)
7768 #else // SNACC_DEEP_COPY
7769 ForwardCertificationPath
&ForwardCertificationPath::operator = (const ForwardCertificationPath
&)
7770 #endif // SNACC_DEEP_COPY
7776 for (; Curr(); RemoveCurrFromList())
7779 //that.SetCurrToFirst();
7780 //for (; that.Curr(); that.GoNext())
7781 // AppendCopy (*that.Curr());
7782 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
7783 AppendCopy (*run
->elmt
);
7787 #else // SNACC_DEEP_COPY
7788 Asn1Error
<< "use of incompletely defined ForwardCertificationPath &ForwardCertificationPath::operator = (const ForwardCertificationPath &)" << endl
;
7790 // if your compiler complains here, check the -novolat option
7791 #endif // SNACC_DEEP_COPY
7794 void ForwardCertificationPath::Print (ostream
&os
) const
7797 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
7798 indentG
+= stdIndentG
;
7800 //for (; Curr() != NULL; GoNext())
7801 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
7803 Indent (os
, indentG
);
7806 //if (Curr() != Last())
7811 indentG
-= stdIndentG
;
7812 Indent (os
, indentG
);
7820 void ForwardCertificationPath::SetCurrElmt (unsigned long int index
)
7822 unsigned long int i
;
7825 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
7827 } // ForwardCertificationPath::SetCurrElmt
7830 unsigned long int ForwardCertificationPath::GetCurrElmtIndex()
7832 unsigned long int i
;
7836 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
7845 } // ForwardCertificationPath::GetCurrElmtIndex
7848 // alloc new list elmt, put at end of list
7849 // and return the component type
7850 CrossCertificates
*ForwardCertificationPath::Append()
7852 AsnListElmt
*newElmt
;
7853 newElmt
= new AsnListElmt
;
7854 newElmt
->elmt
= new CrossCertificates
;
7855 newElmt
->next
= NULL
;
7858 newElmt
->prev
= NULL
;
7859 first
= last
= newElmt
;
7863 newElmt
->prev
= last
;
7864 last
->next
= newElmt
;
7868 return (curr
= newElmt
)->elmt
;
7869 } // ForwardCertificationPath::Append
7872 // alloc new list elmt, put at begining of list
7873 // and return the component type
7874 CrossCertificates
*ForwardCertificationPath::Prepend()
7876 AsnListElmt
*newElmt
;
7877 newElmt
= new AsnListElmt
;
7878 newElmt
->elmt
= new CrossCertificates
;
7879 newElmt
->prev
= NULL
;
7882 newElmt
->next
= NULL
;
7883 first
= last
= newElmt
;
7887 newElmt
->next
= first
;
7888 first
->prev
= newElmt
;
7892 return (curr
= newElmt
)->elmt
;
7893 } // ForwardCertificationPath::Prepend
7896 // alloc new list elmt, insert it before the
7897 // current element and return the component type
7898 // if the current element is null, the new element
7899 // is placed at the beginning of the list.
7900 CrossCertificates
*ForwardCertificationPath::InsertBefore()
7902 AsnListElmt
*newElmt
;
7903 newElmt
= new AsnListElmt
;
7904 newElmt
->elmt
= new CrossCertificates
;
7907 newElmt
->next
= first
;
7908 newElmt
->prev
= NULL
;
7915 newElmt
->next
= curr
;
7916 newElmt
->prev
= curr
->prev
;
7917 curr
->prev
= newElmt
;
7921 newElmt
->prev
->next
= newElmt
;
7924 return (curr
= newElmt
)->elmt
;
7925 } // ForwardCertificationPath::InsertBefore
7928 // alloc new list elmt, insert it after the
7929 // current element and return the component type
7930 // if the current element is null, the new element
7931 // is placed at the end of the list.
7932 CrossCertificates
*ForwardCertificationPath::InsertAfter()
7934 AsnListElmt
*newElmt
;
7935 newElmt
= new AsnListElmt
;
7936 newElmt
->elmt
= new CrossCertificates
;
7939 newElmt
->prev
= last
;
7940 newElmt
->next
= NULL
;
7947 newElmt
->prev
= curr
;
7948 newElmt
->next
= curr
->next
;
7949 curr
->next
= newElmt
;
7953 newElmt
->next
->prev
= newElmt
;
7956 return (curr
= newElmt
)->elmt
;
7957 } // ForwardCertificationPath::InsertAfter
7960 ForwardCertificationPath
&ForwardCertificationPath::AppendCopy (CrossCertificates
&elmt
)
7962 AsnListElmt
*newElmt
;
7963 newElmt
= new AsnListElmt
;
7964 newElmt
->elmt
= new CrossCertificates
;
7965 *newElmt
->elmt
= elmt
;
7966 newElmt
->next
= NULL
;
7969 newElmt
->prev
= NULL
;
7970 first
= last
= newElmt
;
7974 newElmt
->prev
= last
;
7975 last
->next
= newElmt
;
7983 ForwardCertificationPath
&ForwardCertificationPath::PrependCopy (CrossCertificates
&elmt
)
7985 AsnListElmt
*newElmt
;
7986 newElmt
= new AsnListElmt
;
7987 newElmt
->elmt
= new CrossCertificates
;
7988 *newElmt
->elmt
= elmt
;
7989 newElmt
->prev
= NULL
;
7992 newElmt
->next
= NULL
;
7993 first
= last
= newElmt
;
7997 newElmt
->next
= first
;
7998 first
->prev
= newElmt
;
8003 } // ForwardCertificationPath::PrependCopy
8006 // alloc new list elmt, insert it before the
8007 // current element, copy the given elmt into the new elmt
8008 // and return the component type.
8009 // if the current element is null, the new element
8010 // is placed at the beginning of the list.
8011 ForwardCertificationPath
&ForwardCertificationPath::InsertBeforeAndCopy (CrossCertificates
&elmt
)
8013 AsnListElmt
*newElmt
;
8015 newElmt
= new AsnListElmt
;
8016 newElmt
->elmt
= new CrossCertificates
;
8017 *newElmt
->elmt
= elmt
;
8021 newElmt
->next
= first
;
8022 newElmt
->prev
= NULL
;
8029 newElmt
->next
= curr
;
8030 newElmt
->prev
= curr
->prev
;
8031 curr
->prev
= newElmt
;
8035 newElmt
->prev
->next
= newElmt
;
8039 } // ForwardCertificationPath::InsertBeforeAndCopy
8042 // alloc new list elmt, insert it after the
8043 // current element, copy given elmt in to new elmt
8044 // and return the component type
8045 // if the current element is null, the new element
8046 // is placed at the end of the list.
8047 ForwardCertificationPath
&ForwardCertificationPath::InsertAfterAndCopy (CrossCertificates
&elmt
)
8049 AsnListElmt
*newElmt
;
8051 newElmt
= new AsnListElmt
;
8052 newElmt
->elmt
= new CrossCertificates
;
8053 *newElmt
->elmt
= elmt
;
8056 newElmt
->prev
= last
;
8057 newElmt
->next
= NULL
;
8064 newElmt
->prev
= curr
;
8065 newElmt
->next
= curr
->next
;
8066 curr
->next
= newElmt
;
8070 newElmt
->next
->prev
= newElmt
;
8074 } // ForwardCertificationPath::InsertAfterAndCopy
8077 // remove current element from list if current element is not NULL
8078 // The new current element will be the next element.
8079 // If the current element is the last element in the list
8080 // the second but last element will become the new current element.
8081 void ForwardCertificationPath::RemoveCurrFromList()
8083 AsnListElmt
*del_elmt
;
8091 first
= last
= curr
= NULL
;
8092 else if (curr
== first
)
8094 curr
= first
= first
->next
;
8097 else if (curr
== last
)
8099 curr
= last
= last
->prev
;
8104 curr
->prev
->next
= curr
->next
;
8105 curr
->next
->prev
= curr
->prev
;
8108 delete del_elmt
->elmt
;
8114 AsnLen
ForwardCertificationPath::BEncContent (BUF_TYPE b
)
8116 AsnListElmt
*currElmt
;
8118 AsnLen totalLen
= 0;
8119 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
8122 elmtLen
= currElmt
->elmt
->BEncContent (b
);
8123 elmtLen
+= BEncConsLen (b
, elmtLen
);
8125 elmtLen
+= BEncTag1 (b
, UNIV
, CONS
, SET_TAG_CODE
);
8126 totalLen
+= elmtLen
;
8129 } // ForwardCertificationPath::BEncContent
8132 void ForwardCertificationPath::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
8133 AsnLen
&bytesDecoded
, ENV_TYPE env
)
8135 CrossCertificates
*listElmt
;
8137 AsnLen listBytesDecoded
= 0;
8140 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
8142 tag1
= BDecTag (b
, listBytesDecoded
, env
);
8143 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
8145 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
8148 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SET_TAG_CODE
)))
8150 Asn1Error
<< "Unexpected Tag" << endl
;
8151 longjmp (env
, -189);
8154 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
8155 listElmt
= Append();
8156 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
8159 bytesDecoded
+= listBytesDecoded
;
8160 } // ForwardCertificationPath::BDecContent
8163 ACPathData::ACPathData()
8166 attributeCertificate
= NULL
;
8169 ACPathData::ACPathData (const ACPathData
&)
8171 Asn1Error
<< "use of incompletely defined ACPathData::ACPathData (const ACPathData &)" << endl
;
8175 ACPathData::~ACPathData()
8178 delete attributeCertificate
;
8181 AsnType
*ACPathData::Clone() const
8183 return new ACPathData
;
8186 AsnType
*ACPathData::Copy() const
8188 return new ACPathData (*this);
8192 ACPathData
&ACPathData::operator = (const ACPathData
&that
)
8193 #else // SNACC_DEEP_COPY
8194 ACPathData
&ACPathData::operator = (const ACPathData
&)
8195 #endif // SNACC_DEEP_COPY
8200 if (that
.certificate
)
8203 certificate
= new Certificate
;
8204 *certificate
= *that
.certificate
;
8211 if (that
.attributeCertificate
)
8213 if (!attributeCertificate
)
8214 attributeCertificate
= new AttributeCertificate
;
8215 *attributeCertificate
= *that
.attributeCertificate
;
8219 delete attributeCertificate
;
8220 attributeCertificate
= NULL
;
8225 #else // SNACC_DEEP_COPY
8226 Asn1Error
<< "use of incompletely defined ACPathData &ACPathData::operator = (const ACPathData &)" << endl
;
8228 // if your compiler complains here, check the -novolat option
8229 #endif // SNACC_DEEP_COPY
8233 ACPathData::BEncContent (BUF_TYPE b
)
8235 AsnLen totalLen
= 0;
8238 if (NOT_NULL (attributeCertificate
))
8242 l
= attributeCertificate
->BEncContent (b
);
8243 l
+= BEncConsLen (b
, l
);
8245 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8246 l
+= BEncConsLen (b
, l
);
8248 l
+= BEncTag1 (b
, CNTX
, CONS
, 1);
8252 if (NOT_NULL (certificate
))
8256 l
= certificate
->BEncContent (b
);
8257 l
+= BEncConsLen (b
, l
);
8259 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8260 l
+= BEncConsLen (b
, l
);
8262 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
8267 } // ACPathData::BEncContent
8270 void ACPathData::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
8273 AsnLen seqBytesDecoded
= 0;
8280 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
8282 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
8284 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
8285 bytesDecoded
+= seqBytesDecoded
;
8290 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0)))
8292 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
8293 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
8295 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
8297 Asn1Error
<< "Unexpected Tag" << endl
;
8298 longjmp (env
, -190);
8301 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
8302 certificate
= new Certificate
;
8303 certificate
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
8304 if (elmtLen1
== INDEFINITE_LEN
)
8305 BDecEoc (b
, seqBytesDecoded
, env
);
8307 if (seqBytesDecoded
== elmtLen0
)
8309 bytesDecoded
+= seqBytesDecoded
;
8314 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
8316 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
8318 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
8319 bytesDecoded
+= seqBytesDecoded
;
8325 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1)))
8327 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
8328 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
8330 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
8332 Asn1Error
<< "Unexpected Tag" << endl
;
8333 longjmp (env
, -191);
8336 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
8337 attributeCertificate
= new AttributeCertificate
;
8338 attributeCertificate
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
8339 if (elmtLen1
== INDEFINITE_LEN
)
8340 BDecEoc (b
, seqBytesDecoded
, env
);
8344 bytesDecoded
+= seqBytesDecoded
;
8345 if (elmtLen0
== INDEFINITE_LEN
)
8347 BDecEoc (b
, bytesDecoded
, env
);
8350 else if (seqBytesDecoded
!= elmtLen0
)
8352 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
8353 longjmp (env
, -192);
8357 } // ACPathData::BDecContent
8359 AsnLen
ACPathData::BEnc (BUF_TYPE b
)
8362 l
= BEncContent (b
);
8363 l
+= BEncConsLen (b
, l
);
8364 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8368 void ACPathData::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
8373 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
8375 Asn1Error
<< "ACPathData::BDec: ERROR - wrong tag" << endl
;
8376 longjmp (env
, -193);
8378 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
8379 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
8382 int ACPathData::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
8384 bytesEncoded
= BEnc (b
);
8385 return !b
.WriteError();
8388 int ACPathData::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
8394 if ((val
= setjmp (env
)) == 0)
8396 BDec (b
, bytesDecoded
, env
);
8397 return !b
.ReadError();
8403 void ACPathData::Print (ostream
&os
) const
8406 int nonePrinted
= true;
8407 os
<< "{ -- SEQUENCE --" << endl
;
8408 indentG
+= stdIndentG
;
8410 if (NOT_NULL (certificate
))
8412 nonePrinted
= false;
8413 Indent (os
, indentG
);
8414 os
<< "certificate ";
8419 Indent (os
, indentG
);
8420 os
<< "certificate ";
8425 if (NOT_NULL (attributeCertificate
))
8429 nonePrinted
= false;
8430 Indent (os
, indentG
);
8431 os
<< "attributeCertificate ";
8432 os
<< *attributeCertificate
;
8436 Indent (os
, indentG
);
8437 os
<< "attributeCertificate ";
8443 indentG
-= stdIndentG
;
8444 Indent (os
, indentG
);
8447 } // ACPathData::Print
8450 AsnType
*AttributeCertificationPathSeqOf::Clone() const
8452 return new AttributeCertificationPathSeqOf
;
8455 AsnType
*AttributeCertificationPathSeqOf::Copy() const
8457 return new AttributeCertificationPathSeqOf (*this);
8460 AsnLen
AttributeCertificationPathSeqOf::BEnc (BUF_TYPE b
)
8463 l
= BEncContent (b
);
8464 l
+= BEncConsLen (b
, l
);
8465 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8469 void AttributeCertificationPathSeqOf::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
8474 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
8476 Asn1Error
<< "AttributeCertificationPathSeqOf::BDec: ERROR - wrong tag" << endl
;
8477 longjmp (env
, -194);
8479 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
8480 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
8483 AttributeCertificationPathSeqOf::AttributeCertificationPathSeqOf (const AttributeCertificationPathSeqOf
&)
8485 Asn1Error
<< "use of incompletely defined AttributeCertificationPathSeqOf::AttributeCertificationPathSeqOf (const AttributeCertificationPathSeqOf &)" << endl
;
8489 AttributeCertificationPathSeqOf::~AttributeCertificationPathSeqOf()
8492 for (; Curr() != NULL
; RemoveCurrFromList())
8494 } // end of destructor
8497 AttributeCertificationPathSeqOf
&AttributeCertificationPathSeqOf::operator = (const AttributeCertificationPathSeqOf
&that
)
8498 #else // SNACC_DEEP_COPY
8499 AttributeCertificationPathSeqOf
&AttributeCertificationPathSeqOf::operator = (const AttributeCertificationPathSeqOf
&)
8500 #endif // SNACC_DEEP_COPY
8506 for (; Curr(); RemoveCurrFromList())
8509 //that.SetCurrToFirst();
8510 //for (; that.Curr(); that.GoNext())
8511 // AppendCopy (*that.Curr());
8512 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
8513 AppendCopy (*run
->elmt
);
8517 #else // SNACC_DEEP_COPY
8518 Asn1Error
<< "use of incompletely defined AttributeCertificationPathSeqOf &AttributeCertificationPathSeqOf::operator = (const AttributeCertificationPathSeqOf &)" << endl
;
8520 // if your compiler complains here, check the -novolat option
8521 #endif // SNACC_DEEP_COPY
8524 void AttributeCertificationPathSeqOf::Print (ostream
&os
) const
8527 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
8528 indentG
+= stdIndentG
;
8530 //for (; Curr() != NULL; GoNext())
8531 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
8533 Indent (os
, indentG
);
8536 //if (Curr() != Last())
8541 indentG
-= stdIndentG
;
8542 Indent (os
, indentG
);
8550 void AttributeCertificationPathSeqOf::SetCurrElmt (unsigned long int index
)
8552 unsigned long int i
;
8555 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
8557 } // AttributeCertificationPathSeqOf::SetCurrElmt
8560 unsigned long int AttributeCertificationPathSeqOf::GetCurrElmtIndex()
8562 unsigned long int i
;
8566 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
8575 } // AttributeCertificationPathSeqOf::GetCurrElmtIndex
8578 // alloc new list elmt, put at end of list
8579 // and return the component type
8580 ACPathData
*AttributeCertificationPathSeqOf::Append()
8582 AsnListElmt
*newElmt
;
8583 newElmt
= new AsnListElmt
;
8584 newElmt
->elmt
= new ACPathData
;
8585 newElmt
->next
= NULL
;
8588 newElmt
->prev
= NULL
;
8589 first
= last
= newElmt
;
8593 newElmt
->prev
= last
;
8594 last
->next
= newElmt
;
8598 return (curr
= newElmt
)->elmt
;
8599 } // AttributeCertificationPathSeqOf::Append
8602 // alloc new list elmt, put at begining of list
8603 // and return the component type
8604 ACPathData
*AttributeCertificationPathSeqOf::Prepend()
8606 AsnListElmt
*newElmt
;
8607 newElmt
= new AsnListElmt
;
8608 newElmt
->elmt
= new ACPathData
;
8609 newElmt
->prev
= NULL
;
8612 newElmt
->next
= NULL
;
8613 first
= last
= newElmt
;
8617 newElmt
->next
= first
;
8618 first
->prev
= newElmt
;
8622 return (curr
= newElmt
)->elmt
;
8623 } // AttributeCertificationPathSeqOf::Prepend
8626 // alloc new list elmt, insert it before the
8627 // current element and return the component type
8628 // if the current element is null, the new element
8629 // is placed at the beginning of the list.
8630 ACPathData
*AttributeCertificationPathSeqOf::InsertBefore()
8632 AsnListElmt
*newElmt
;
8633 newElmt
= new AsnListElmt
;
8634 newElmt
->elmt
= new ACPathData
;
8637 newElmt
->next
= first
;
8638 newElmt
->prev
= NULL
;
8645 newElmt
->next
= curr
;
8646 newElmt
->prev
= curr
->prev
;
8647 curr
->prev
= newElmt
;
8651 newElmt
->prev
->next
= newElmt
;
8654 return (curr
= newElmt
)->elmt
;
8655 } // AttributeCertificationPathSeqOf::InsertBefore
8658 // alloc new list elmt, insert it after the
8659 // current element and return the component type
8660 // if the current element is null, the new element
8661 // is placed at the end of the list.
8662 ACPathData
*AttributeCertificationPathSeqOf::InsertAfter()
8664 AsnListElmt
*newElmt
;
8665 newElmt
= new AsnListElmt
;
8666 newElmt
->elmt
= new ACPathData
;
8669 newElmt
->prev
= last
;
8670 newElmt
->next
= NULL
;
8677 newElmt
->prev
= curr
;
8678 newElmt
->next
= curr
->next
;
8679 curr
->next
= newElmt
;
8683 newElmt
->next
->prev
= newElmt
;
8686 return (curr
= newElmt
)->elmt
;
8687 } // AttributeCertificationPathSeqOf::InsertAfter
8690 AttributeCertificationPathSeqOf
&AttributeCertificationPathSeqOf::AppendCopy (ACPathData
&elmt
)
8692 AsnListElmt
*newElmt
;
8693 newElmt
= new AsnListElmt
;
8694 newElmt
->elmt
= new ACPathData
;
8695 *newElmt
->elmt
= elmt
;
8696 newElmt
->next
= NULL
;
8699 newElmt
->prev
= NULL
;
8700 first
= last
= newElmt
;
8704 newElmt
->prev
= last
;
8705 last
->next
= newElmt
;
8713 AttributeCertificationPathSeqOf
&AttributeCertificationPathSeqOf::PrependCopy (ACPathData
&elmt
)
8715 AsnListElmt
*newElmt
;
8716 newElmt
= new AsnListElmt
;
8717 newElmt
->elmt
= new ACPathData
;
8718 *newElmt
->elmt
= elmt
;
8719 newElmt
->prev
= NULL
;
8722 newElmt
->next
= NULL
;
8723 first
= last
= newElmt
;
8727 newElmt
->next
= first
;
8728 first
->prev
= newElmt
;
8733 } // AttributeCertificationPathSeqOf::PrependCopy
8736 // alloc new list elmt, insert it before the
8737 // current element, copy the given elmt into the new elmt
8738 // and return the component type.
8739 // if the current element is null, the new element
8740 // is placed at the beginning of the list.
8741 AttributeCertificationPathSeqOf
&AttributeCertificationPathSeqOf::InsertBeforeAndCopy (ACPathData
&elmt
)
8743 AsnListElmt
*newElmt
;
8745 newElmt
= new AsnListElmt
;
8746 newElmt
->elmt
= new ACPathData
;
8747 *newElmt
->elmt
= elmt
;
8751 newElmt
->next
= first
;
8752 newElmt
->prev
= NULL
;
8759 newElmt
->next
= curr
;
8760 newElmt
->prev
= curr
->prev
;
8761 curr
->prev
= newElmt
;
8765 newElmt
->prev
->next
= newElmt
;
8769 } // AttributeCertificationPathSeqOf::InsertBeforeAndCopy
8772 // alloc new list elmt, insert it after the
8773 // current element, copy given elmt in to new elmt
8774 // and return the component type
8775 // if the current element is null, the new element
8776 // is placed at the end of the list.
8777 AttributeCertificationPathSeqOf
&AttributeCertificationPathSeqOf::InsertAfterAndCopy (ACPathData
&elmt
)
8779 AsnListElmt
*newElmt
;
8781 newElmt
= new AsnListElmt
;
8782 newElmt
->elmt
= new ACPathData
;
8783 *newElmt
->elmt
= elmt
;
8786 newElmt
->prev
= last
;
8787 newElmt
->next
= NULL
;
8794 newElmt
->prev
= curr
;
8795 newElmt
->next
= curr
->next
;
8796 curr
->next
= newElmt
;
8800 newElmt
->next
->prev
= newElmt
;
8804 } // AttributeCertificationPathSeqOf::InsertAfterAndCopy
8807 // remove current element from list if current element is not NULL
8808 // The new current element will be the next element.
8809 // If the current element is the last element in the list
8810 // the second but last element will become the new current element.
8811 void AttributeCertificationPathSeqOf::RemoveCurrFromList()
8813 AsnListElmt
*del_elmt
;
8821 first
= last
= curr
= NULL
;
8822 else if (curr
== first
)
8824 curr
= first
= first
->next
;
8827 else if (curr
== last
)
8829 curr
= last
= last
->prev
;
8834 curr
->prev
->next
= curr
->next
;
8835 curr
->next
->prev
= curr
->prev
;
8838 delete del_elmt
->elmt
;
8844 AsnLen
AttributeCertificationPathSeqOf::BEncContent (BUF_TYPE b
)
8846 AsnListElmt
*currElmt
;
8848 AsnLen totalLen
= 0;
8849 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
8852 elmtLen
= currElmt
->elmt
->BEncContent (b
);
8853 elmtLen
+= BEncConsLen (b
, elmtLen
);
8855 elmtLen
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8856 totalLen
+= elmtLen
;
8859 } // AttributeCertificationPathSeqOf::BEncContent
8862 void AttributeCertificationPathSeqOf::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
8863 AsnLen
&bytesDecoded
, ENV_TYPE env
)
8865 ACPathData
*listElmt
;
8867 AsnLen listBytesDecoded
= 0;
8870 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
8872 tag1
= BDecTag (b
, listBytesDecoded
, env
);
8873 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
8875 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
8878 if ((tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
8880 Asn1Error
<< "Unexpected Tag" << endl
;
8881 longjmp (env
, -195);
8884 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
8885 listElmt
= Append();
8886 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
8889 bytesDecoded
+= listBytesDecoded
;
8890 } // AttributeCertificationPathSeqOf::BDecContent
8893 Certificates::Certificates()
8896 userCertificate
= new Certificate
;
8898 userCertificate
= NULL
; // incomplete initialization of mandatory element!
8900 certificationPath
= NULL
;
8903 Certificates::Certificates (const Certificates
&)
8905 Asn1Error
<< "use of incompletely defined Certificates::Certificates (const Certificates &)" << endl
;
8909 Certificates::~Certificates()
8911 delete userCertificate
;
8912 delete certificationPath
;
8915 AsnType
*Certificates::Clone() const
8917 return new Certificates
;
8920 AsnType
*Certificates::Copy() const
8922 return new Certificates (*this);
8926 Certificates
&Certificates::operator = (const Certificates
&that
)
8927 #else // SNACC_DEEP_COPY
8928 Certificates
&Certificates::operator = (const Certificates
&)
8929 #endif // SNACC_DEEP_COPY
8934 if (that
.userCertificate
)
8936 if (!userCertificate
)
8937 userCertificate
= new Certificate
;
8938 *userCertificate
= *that
.userCertificate
;
8942 delete userCertificate
;
8943 userCertificate
= NULL
;
8945 if (that
.certificationPath
)
8947 if (!certificationPath
)
8948 certificationPath
= new ForwardCertificationPath
;
8949 *certificationPath
= *that
.certificationPath
;
8953 delete certificationPath
;
8954 certificationPath
= NULL
;
8959 #else // SNACC_DEEP_COPY
8960 Asn1Error
<< "use of incompletely defined Certificates &Certificates::operator = (const Certificates &)" << endl
;
8962 // if your compiler complains here, check the -novolat option
8963 #endif // SNACC_DEEP_COPY
8967 Certificates::BEncContent (BUF_TYPE b
)
8969 AsnLen totalLen
= 0;
8972 if (NOT_NULL (certificationPath
))
8975 l
= certificationPath
->BEncContent (b
);
8976 l
+= BEncConsLen (b
, l
);
8978 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8983 l
= userCertificate
->BEncContent (b
);
8984 l
+= BEncConsLen (b
, l
);
8986 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
8990 } // Certificates::BEncContent
8993 void Certificates::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
8996 AsnLen seqBytesDecoded
= 0;
8998 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9000 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
9002 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9003 userCertificate
= new Certificate
;
9004 userCertificate
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
9005 if (seqBytesDecoded
== elmtLen0
)
9007 bytesDecoded
+= seqBytesDecoded
;
9012 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9014 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9016 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9017 bytesDecoded
+= seqBytesDecoded
;
9024 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
9025 longjmp (env
, -196);
9028 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
9030 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9031 certificationPath
= new ForwardCertificationPath
;
9032 certificationPath
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
9035 bytesDecoded
+= seqBytesDecoded
;
9036 if (elmtLen0
== INDEFINITE_LEN
)
9038 BDecEoc (b
, bytesDecoded
, env
);
9041 else if (seqBytesDecoded
!= elmtLen0
)
9043 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
9044 longjmp (env
, -197);
9048 } // Certificates::BDecContent
9050 AsnLen
Certificates::BEnc (BUF_TYPE b
)
9053 l
= BEncContent (b
);
9054 l
+= BEncConsLen (b
, l
);
9055 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9059 void Certificates::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9064 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
9066 Asn1Error
<< "Certificates::BDec: ERROR - wrong tag" << endl
;
9067 longjmp (env
, -198);
9069 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
9070 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
9073 int Certificates::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
9075 bytesEncoded
= BEnc (b
);
9076 return !b
.WriteError();
9079 int Certificates::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
9085 if ((val
= setjmp (env
)) == 0)
9087 BDec (b
, bytesDecoded
, env
);
9088 return !b
.ReadError();
9094 void Certificates::Print (ostream
&os
) const
9097 os
<< "{ -- SEQUENCE --" << endl
;
9098 indentG
+= stdIndentG
;
9100 if (NOT_NULL (userCertificate
))
9102 Indent (os
, indentG
);
9103 os
<< "userCertificate ";
9104 os
<< *userCertificate
;
9108 Indent (os
, indentG
);
9109 os
<< "userCertificate ";
9114 if (NOT_NULL (certificationPath
))
9117 Indent (os
, indentG
);
9118 os
<< "certificationPath ";
9119 os
<< *certificationPath
;
9123 Indent (os
, indentG
);
9124 os
<< "certificationPath ";
9130 indentG
-= stdIndentG
;
9131 Indent (os
, indentG
);
9134 } // Certificates::Print
9137 CertificationPath::CertificationPath()
9140 userCertificate
= new Certificate
;
9142 userCertificate
= NULL
; // incomplete initialization of mandatory element!
9144 theCACertificates
= NULL
;
9147 CertificationPath::CertificationPath (const CertificationPath
&)
9149 Asn1Error
<< "use of incompletely defined CertificationPath::CertificationPath (const CertificationPath &)" << endl
;
9153 CertificationPath::~CertificationPath()
9155 delete userCertificate
;
9156 delete theCACertificates
;
9159 AsnType
*CertificationPath::Clone() const
9161 return new CertificationPath
;
9164 AsnType
*CertificationPath::Copy() const
9166 return new CertificationPath (*this);
9170 CertificationPath
&CertificationPath::operator = (const CertificationPath
&that
)
9171 #else // SNACC_DEEP_COPY
9172 CertificationPath
&CertificationPath::operator = (const CertificationPath
&)
9173 #endif // SNACC_DEEP_COPY
9178 if (that
.userCertificate
)
9180 if (!userCertificate
)
9181 userCertificate
= new Certificate
;
9182 *userCertificate
= *that
.userCertificate
;
9186 delete userCertificate
;
9187 userCertificate
= NULL
;
9189 if (that
.theCACertificates
)
9191 if (!theCACertificates
)
9192 theCACertificates
= new CertificationPathSeqOf
;
9193 *theCACertificates
= *that
.theCACertificates
;
9197 delete theCACertificates
;
9198 theCACertificates
= NULL
;
9203 #else // SNACC_DEEP_COPY
9204 Asn1Error
<< "use of incompletely defined CertificationPath &CertificationPath::operator = (const CertificationPath &)" << endl
;
9206 // if your compiler complains here, check the -novolat option
9207 #endif // SNACC_DEEP_COPY
9211 CertificationPath::BEncContent (BUF_TYPE b
)
9213 AsnLen totalLen
= 0;
9216 if (NOT_NULL (theCACertificates
))
9219 l
= theCACertificates
->BEncContent (b
);
9220 l
+= BEncConsLen (b
, l
);
9222 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9227 l
= userCertificate
->BEncContent (b
);
9228 l
+= BEncConsLen (b
, l
);
9230 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9234 } // CertificationPath::BEncContent
9237 void CertificationPath::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9240 AsnLen seqBytesDecoded
= 0;
9242 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9244 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
9246 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9247 userCertificate
= new Certificate
;
9248 userCertificate
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
9249 if (seqBytesDecoded
== elmtLen0
)
9251 bytesDecoded
+= seqBytesDecoded
;
9256 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9258 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9260 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9261 bytesDecoded
+= seqBytesDecoded
;
9268 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
9269 longjmp (env
, -199);
9272 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
9274 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9275 theCACertificates
= new CertificationPathSeqOf
;
9276 theCACertificates
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
9279 bytesDecoded
+= seqBytesDecoded
;
9280 if (elmtLen0
== INDEFINITE_LEN
)
9282 BDecEoc (b
, bytesDecoded
, env
);
9285 else if (seqBytesDecoded
!= elmtLen0
)
9287 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
9288 longjmp (env
, -200);
9292 } // CertificationPath::BDecContent
9294 AsnLen
CertificationPath::BEnc (BUF_TYPE b
)
9297 l
= BEncContent (b
);
9298 l
+= BEncConsLen (b
, l
);
9299 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9303 void CertificationPath::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9308 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
9310 Asn1Error
<< "CertificationPath::BDec: ERROR - wrong tag" << endl
;
9311 longjmp (env
, -201);
9313 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
9314 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
9317 int CertificationPath::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
9319 bytesEncoded
= BEnc (b
);
9320 return !b
.WriteError();
9323 int CertificationPath::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
9329 if ((val
= setjmp (env
)) == 0)
9331 BDec (b
, bytesDecoded
, env
);
9332 return !b
.ReadError();
9338 void CertificationPath::Print (ostream
&os
) const
9341 os
<< "{ -- SEQUENCE --" << endl
;
9342 indentG
+= stdIndentG
;
9344 if (NOT_NULL (userCertificate
))
9346 Indent (os
, indentG
);
9347 os
<< "userCertificate ";
9348 os
<< *userCertificate
;
9352 Indent (os
, indentG
);
9353 os
<< "userCertificate ";
9358 if (NOT_NULL (theCACertificates
))
9361 Indent (os
, indentG
);
9362 os
<< "theCACertificates ";
9363 os
<< *theCACertificates
;
9367 Indent (os
, indentG
);
9368 os
<< "theCACertificates ";
9374 indentG
-= stdIndentG
;
9375 Indent (os
, indentG
);
9378 } // CertificationPath::Print
9381 AttributeCertificationPath::AttributeCertificationPath()
9384 attributeCertificate
= new AttributeCertificate
;
9386 attributeCertificate
= NULL
; // incomplete initialization of mandatory element!
9391 AttributeCertificationPath::AttributeCertificationPath (const AttributeCertificationPath
&)
9393 Asn1Error
<< "use of incompletely defined AttributeCertificationPath::AttributeCertificationPath (const AttributeCertificationPath &)" << endl
;
9397 AttributeCertificationPath::~AttributeCertificationPath()
9399 delete attributeCertificate
;
9403 AsnType
*AttributeCertificationPath::Clone() const
9405 return new AttributeCertificationPath
;
9408 AsnType
*AttributeCertificationPath::Copy() const
9410 return new AttributeCertificationPath (*this);
9414 AttributeCertificationPath
&AttributeCertificationPath::operator = (const AttributeCertificationPath
&that
)
9415 #else // SNACC_DEEP_COPY
9416 AttributeCertificationPath
&AttributeCertificationPath::operator = (const AttributeCertificationPath
&)
9417 #endif // SNACC_DEEP_COPY
9422 if (that
.attributeCertificate
)
9424 if (!attributeCertificate
)
9425 attributeCertificate
= new AttributeCertificate
;
9426 *attributeCertificate
= *that
.attributeCertificate
;
9430 delete attributeCertificate
;
9431 attributeCertificate
= NULL
;
9436 acPath
= new AttributeCertificationPathSeqOf
;
9437 *acPath
= *that
.acPath
;
9447 #else // SNACC_DEEP_COPY
9448 Asn1Error
<< "use of incompletely defined AttributeCertificationPath &AttributeCertificationPath::operator = (const AttributeCertificationPath &)" << endl
;
9450 // if your compiler complains here, check the -novolat option
9451 #endif // SNACC_DEEP_COPY
9455 AttributeCertificationPath::BEncContent (BUF_TYPE b
)
9457 AsnLen totalLen
= 0;
9460 if (NOT_NULL (acPath
))
9463 l
= acPath
->BEncContent (b
);
9464 l
+= BEncConsLen (b
, l
);
9466 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9471 l
= attributeCertificate
->BEncContent (b
);
9472 l
+= BEncConsLen (b
, l
);
9474 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9478 } // AttributeCertificationPath::BEncContent
9481 void AttributeCertificationPath::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9484 AsnLen seqBytesDecoded
= 0;
9486 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9488 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
9490 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9491 attributeCertificate
= new AttributeCertificate
;
9492 attributeCertificate
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
9493 if (seqBytesDecoded
== elmtLen0
)
9495 bytesDecoded
+= seqBytesDecoded
;
9500 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9502 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9504 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9505 bytesDecoded
+= seqBytesDecoded
;
9512 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
9513 longjmp (env
, -202);
9516 if ((tag1
== MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
)))
9518 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9519 acPath
= new AttributeCertificationPathSeqOf
;
9520 acPath
->BDecContent (b
, tag1
, elmtLen1
, seqBytesDecoded
, env
);
9523 bytesDecoded
+= seqBytesDecoded
;
9524 if (elmtLen0
== INDEFINITE_LEN
)
9526 BDecEoc (b
, bytesDecoded
, env
);
9529 else if (seqBytesDecoded
!= elmtLen0
)
9531 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
9532 longjmp (env
, -203);
9536 } // AttributeCertificationPath::BDecContent
9538 AsnLen
AttributeCertificationPath::BEnc (BUF_TYPE b
)
9541 l
= BEncContent (b
);
9542 l
+= BEncConsLen (b
, l
);
9543 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9547 void AttributeCertificationPath::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9552 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
9554 Asn1Error
<< "AttributeCertificationPath::BDec: ERROR - wrong tag" << endl
;
9555 longjmp (env
, -204);
9557 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
9558 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
9561 int AttributeCertificationPath::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
9563 bytesEncoded
= BEnc (b
);
9564 return !b
.WriteError();
9567 int AttributeCertificationPath::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
9573 if ((val
= setjmp (env
)) == 0)
9575 BDec (b
, bytesDecoded
, env
);
9576 return !b
.ReadError();
9582 void AttributeCertificationPath::Print (ostream
&os
) const
9585 os
<< "{ -- SEQUENCE --" << endl
;
9586 indentG
+= stdIndentG
;
9588 if (NOT_NULL (attributeCertificate
))
9590 Indent (os
, indentG
);
9591 os
<< "attributeCertificate ";
9592 os
<< *attributeCertificate
;
9596 Indent (os
, indentG
);
9597 os
<< "attributeCertificate ";
9602 if (NOT_NULL (acPath
))
9605 Indent (os
, indentG
);
9611 Indent (os
, indentG
);
9618 indentG
-= stdIndentG
;
9619 Indent (os
, indentG
);
9622 } // AttributeCertificationPath::Print
9625 AttributeCertificateAssertion::AttributeCertificateAssertion()
9629 attCertValidity
= NULL
;
9633 AttributeCertificateAssertion::AttributeCertificateAssertion (const AttributeCertificateAssertion
&)
9635 Asn1Error
<< "use of incompletely defined AttributeCertificateAssertion::AttributeCertificateAssertion (const AttributeCertificateAssertion &)" << endl
;
9639 AttributeCertificateAssertion::~AttributeCertificateAssertion()
9643 delete attCertValidity
;
9647 AsnType
*AttributeCertificateAssertion::Clone() const
9649 return new AttributeCertificateAssertion
;
9652 AsnType
*AttributeCertificateAssertion::Copy() const
9654 return new AttributeCertificateAssertion (*this);
9658 AttributeCertificateAssertion
&AttributeCertificateAssertion::operator = (const AttributeCertificateAssertion
&that
)
9659 #else // SNACC_DEEP_COPY
9660 AttributeCertificateAssertion
&AttributeCertificateAssertion::operator = (const AttributeCertificateAssertion
&)
9661 #endif // SNACC_DEEP_COPY
9669 subject
= new AttributeCertificateAssertionChoice
;
9670 *subject
= *that
.subject
;
9681 *issuer
= *that
.issuer
;
9688 if (that
.attCertValidity
)
9690 if (!attCertValidity
)
9691 attCertValidity
= new GeneralizedTime
;
9692 *attCertValidity
= *that
.attCertValidity
;
9696 delete attCertValidity
;
9697 attCertValidity
= NULL
;
9702 attType
= new AttributeCertificateAssertionSetOf
;
9703 *attType
= *that
.attType
;
9713 #else // SNACC_DEEP_COPY
9714 Asn1Error
<< "use of incompletely defined AttributeCertificateAssertion &AttributeCertificateAssertion::operator = (const AttributeCertificateAssertion &)" << endl
;
9716 // if your compiler complains here, check the -novolat option
9717 #endif // SNACC_DEEP_COPY
9721 AttributeCertificateAssertion::BEncContent (BUF_TYPE b
)
9723 AsnLen totalLen
= 0;
9726 if (NOT_NULL (attType
))
9730 l
= attType
->BEncContent (b
);
9731 l
+= BEncConsLen (b
, l
);
9733 l
+= BEncTag1 (b
, UNIV
, CONS
, SET_TAG_CODE
);
9734 l
+= BEncConsLen (b
, l
);
9736 l
+= BEncTag1 (b
, CNTX
, CONS
, 3);
9740 if (NOT_NULL (attCertValidity
))
9743 l
= attCertValidity
->BEncContent (b
);
9744 l
+= BEncDefLen (b
, l
);
9746 l
+= BEncTag1 (b
, UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
);
9747 l
+= BEncConsLen (b
, l
);
9749 l
+= BEncTag1 (b
, CNTX
, CONS
, 2);
9753 if (NOT_NULL (issuer
))
9756 l
= issuer
->BEncContent (b
);
9757 l
+= BEncConsLen (b
, l
);
9759 l
+= BEncTag1 (b
, CNTX
, CONS
, 1);
9763 if (NOT_NULL (subject
))
9766 l
= subject
->BEncContent (b
);
9767 l
+= BEncConsLen (b
, l
);
9769 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
9774 } // AttributeCertificateAssertion::BEncContent
9777 void AttributeCertificateAssertion::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9780 AsnLen seqBytesDecoded
= 0;
9787 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9789 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9791 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9792 bytesDecoded
+= seqBytesDecoded
;
9797 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0)))
9799 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9800 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9801 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
9802 subject
= new AttributeCertificateAssertionChoice
;
9803 subject
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
9804 if (elmtLen1
== INDEFINITE_LEN
)
9805 BDecEoc (b
, seqBytesDecoded
, env
);
9807 if (seqBytesDecoded
== elmtLen0
)
9809 bytesDecoded
+= seqBytesDecoded
;
9814 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9816 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9818 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9819 bytesDecoded
+= seqBytesDecoded
;
9825 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1)))
9827 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9828 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9829 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
9831 issuer
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
9832 if (elmtLen1
== INDEFINITE_LEN
)
9833 BDecEoc (b
, seqBytesDecoded
, env
);
9835 if (seqBytesDecoded
== elmtLen0
)
9837 bytesDecoded
+= seqBytesDecoded
;
9842 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9844 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9846 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9847 bytesDecoded
+= seqBytesDecoded
;
9853 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 2)))
9855 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9856 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9858 if ((tag1
!= MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))
9859 && (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
9861 Asn1Error
<< "Unexpected Tag" << endl
;
9862 longjmp (env
, -205);
9865 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
9866 attCertValidity
= new GeneralizedTime
;
9867 attCertValidity
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
9868 if (elmtLen1
== INDEFINITE_LEN
)
9869 BDecEoc (b
, seqBytesDecoded
, env
);
9871 if (seqBytesDecoded
== elmtLen0
)
9873 bytesDecoded
+= seqBytesDecoded
;
9878 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9880 if ((elmtLen0
== INDEFINITE_LEN
) && (tag1
== EOC_TAG_ID
))
9882 BDEC_2ND_EOC_OCTET (b
, seqBytesDecoded
, env
)
9883 bytesDecoded
+= seqBytesDecoded
;
9889 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 3)))
9891 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
9892 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
9894 if (tag1
!= MAKE_TAG_ID (UNIV
, CONS
, SET_TAG_CODE
))
9896 Asn1Error
<< "Unexpected Tag" << endl
;
9897 longjmp (env
, -206);
9900 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
9901 attType
= new AttributeCertificateAssertionSetOf
;
9902 attType
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
9903 if (elmtLen1
== INDEFINITE_LEN
)
9904 BDecEoc (b
, seqBytesDecoded
, env
);
9908 bytesDecoded
+= seqBytesDecoded
;
9909 if (elmtLen0
== INDEFINITE_LEN
)
9911 BDecEoc (b
, bytesDecoded
, env
);
9914 else if (seqBytesDecoded
!= elmtLen0
)
9916 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
9917 longjmp (env
, -207);
9921 } // AttributeCertificateAssertion::BDecContent
9923 AsnLen
AttributeCertificateAssertion::BEnc (BUF_TYPE b
)
9926 l
= BEncContent (b
);
9927 l
+= BEncConsLen (b
, l
);
9928 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
9932 void AttributeCertificateAssertion::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
9937 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
9939 Asn1Error
<< "AttributeCertificateAssertion::BDec: ERROR - wrong tag" << endl
;
9940 longjmp (env
, -208);
9942 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
9943 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
9946 int AttributeCertificateAssertion::BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
)
9948 bytesEncoded
= BEnc (b
);
9949 return !b
.WriteError();
9952 int AttributeCertificateAssertion::BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
)
9958 if ((val
= setjmp (env
)) == 0)
9960 BDec (b
, bytesDecoded
, env
);
9961 return !b
.ReadError();
9967 void AttributeCertificateAssertion::Print (ostream
&os
) const
9970 int nonePrinted
= true;
9971 os
<< "{ -- SEQUENCE --" << endl
;
9972 indentG
+= stdIndentG
;
9974 if (NOT_NULL (subject
))
9976 nonePrinted
= false;
9977 Indent (os
, indentG
);
9983 Indent (os
, indentG
);
9989 if (NOT_NULL (issuer
))
9993 nonePrinted
= false;
9994 Indent (os
, indentG
);
10000 Indent (os
, indentG
);
10002 os
<< "-- void --";
10006 if (NOT_NULL (attCertValidity
))
10010 nonePrinted
= false;
10011 Indent (os
, indentG
);
10012 os
<< "attCertValidity ";
10013 os
<< *attCertValidity
;
10017 Indent (os
, indentG
);
10018 os
<< "attCertValidity ";
10019 os
<< "-- void --";
10023 if (NOT_NULL (attType
))
10027 nonePrinted
= false;
10028 Indent (os
, indentG
);
10034 Indent (os
, indentG
);
10036 os
<< "-- void --";
10041 indentG
-= stdIndentG
;
10042 Indent (os
, indentG
);
10044 #endif /* NDEBUG */
10045 } // AttributeCertificateAssertion::Print