1 // NOTE: this is a machine generated file--editing not recommended
3 // sm_x509cmn.cpp - class member functions for ASN.1 module CommonX509Definitions
5 // This file was generated by snacc on Mon Apr 22 22:34:19 2002
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"
29 //------------------------------------------------------------------------------
33 //------------------------------------------------------------------------------
34 // class member definitions:
36 EDIPartyName::EDIPartyName()
40 partyName
= new DirectoryString
;
42 partyName
= NULL
; // incomplete initialization of mandatory element!
46 EDIPartyName::EDIPartyName (const EDIPartyName
&)
48 Asn1Error
<< "use of incompletely defined EDIPartyName::EDIPartyName (const EDIPartyName &)" << endl
;
52 EDIPartyName::~EDIPartyName()
58 AsnType
*EDIPartyName::Clone() const
60 return new EDIPartyName
;
63 AsnType
*EDIPartyName::Copy() const
65 return new EDIPartyName (*this);
69 EDIPartyName
&EDIPartyName::operator = (const EDIPartyName
&that
)
70 #else // SNACC_DEEP_COPY
71 EDIPartyName
&EDIPartyName::operator = (const EDIPartyName
&)
72 #endif // SNACC_DEEP_COPY
77 if (that
.nameAssigner
)
80 nameAssigner
= new DirectoryString
;
81 *nameAssigner
= *that
.nameAssigner
;
91 partyName
= new DirectoryString
;
92 *partyName
= *that
.partyName
;
102 #else // SNACC_DEEP_COPY
103 Asn1Error
<< "use of incompletely defined EDIPartyName &EDIPartyName::operator = (const EDIPartyName &)" << endl
;
105 // if your compiler complains here, check the -novolat option
106 #endif // SNACC_DEEP_COPY
110 EDIPartyName::BEncContent (BUF_TYPE b
)
116 l
= partyName
->BEncContent (b
);
117 l
+= BEncConsLen (b
, l
);
119 l
+= BEncTag1 (b
, CNTX
, CONS
, 1);
122 if (NOT_NULL (nameAssigner
))
125 l
= nameAssigner
->BEncContent (b
);
126 l
+= BEncConsLen (b
, l
);
128 l
+= BEncTag1 (b
, CNTX
, CONS
, 0);
133 } // EDIPartyName::BEncContent
136 void EDIPartyName::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
139 AsnLen seqBytesDecoded
= 0;
142 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
144 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 0)))
146 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
147 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
148 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
149 nameAssigner
= new DirectoryString
;
150 nameAssigner
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
151 if (elmtLen1
== INDEFINITE_LEN
)
152 BDecEoc (b
, seqBytesDecoded
, env
);
154 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
157 if ((tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1)))
159 elmtLen1
= BDecLen (b
, seqBytesDecoded
, env
);
160 tag1
= BDecTag (b
, seqBytesDecoded
, env
);
161 elmtLen2
= BDecLen (b
, seqBytesDecoded
, env
);
162 partyName
= new DirectoryString
;
163 partyName
->BDecContent (b
, tag1
, elmtLen2
, seqBytesDecoded
, env
);
164 if (elmtLen1
== INDEFINITE_LEN
)
165 BDecEoc (b
, seqBytesDecoded
, env
);
170 Asn1Error
<< "ERROR - SEQUENCE is missing non-optional elmt." << endl
;
171 SnaccExcep::throwMe(-100);
174 bytesDecoded
+= seqBytesDecoded
;
175 if (elmtLen0
== INDEFINITE_LEN
)
177 BDecEoc (b
, bytesDecoded
, env
);
180 else if (seqBytesDecoded
!= elmtLen0
)
182 Asn1Error
<< "ERROR - Length discrepancy on sequence." << endl
;
183 SnaccExcep::throwMe(-101);
187 } // EDIPartyName::BDecContent
189 AsnLen
EDIPartyName::BEnc (BUF_TYPE b
)
193 l
+= BEncConsLen (b
, l
);
194 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
198 void EDIPartyName::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
203 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
205 Asn1Error
<< "EDIPartyName::BDec: ERROR - wrong tag" << endl
;
206 SnaccExcep::throwMe(-102);
208 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
209 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
212 void EDIPartyName::Print (ostream
&os
) const
215 os
<< "{ -- SEQUENCE --" << endl
;
216 indentG
+= stdIndentG
;
218 if (NOT_NULL (nameAssigner
))
220 Indent (os
, indentG
);
221 os
<< "nameAssigner ";
226 Indent (os
, indentG
);
227 os
<< "nameAssigner ";
232 if (NOT_NULL (partyName
))
234 Indent (os
, indentG
);
240 Indent (os
, indentG
);
247 indentG
-= stdIndentG
;
248 Indent (os
, indentG
);
251 } // EDIPartyName::Print
254 GeneralName::GeneralName()
256 choiceId
= otherNameCid
;
258 otherName
= new OTHER_NAME
;
260 otherName
= NULL
; // incomplete initialization of mandatory element!
264 GeneralName::GeneralName (const GeneralName
&)
266 Asn1Error
<< "use of incompletely defined GeneralName::GeneralName (const GeneralName &)" << endl
;
270 GeneralName::~GeneralName()
286 case directoryNameCid
:
287 delete directoryName
;
289 case ediPartyNameCid
:
292 case uniformResourceIdentifierCid
:
293 delete uniformResourceIdentifier
;
298 case registeredIDCid
:
302 } // end of destructor
304 AsnType
*GeneralName::Clone() const
306 return new GeneralName
;
309 AsnType
*GeneralName::Copy() const
311 return new GeneralName (*this);
315 GeneralName
&GeneralName::operator = (const GeneralName
&that
)
316 #else // SNACC_DEEP_COPY
317 GeneralName
&GeneralName::operator = (const GeneralName
&)
318 #endif // SNACC_DEEP_COPY
337 case directoryNameCid
:
338 delete directoryName
;
340 case ediPartyNameCid
:
343 case uniformResourceIdentifierCid
:
344 delete uniformResourceIdentifier
;
349 case registeredIDCid
:
353 switch (choiceId
= that
.choiceId
)
356 otherName
= new OTHER_NAME
;
357 *otherName
= *that
.otherName
;
360 rfc822Name
= new IA5String
;
361 *rfc822Name
= *that
.rfc822Name
;
364 dNSName
= new IA5String
;
365 *dNSName
= *that
.dNSName
;
368 x400Address
= new ORAddress
;
369 *x400Address
= *that
.x400Address
;
371 case directoryNameCid
:
372 directoryName
= new Name
;
373 *directoryName
= *that
.directoryName
;
375 case ediPartyNameCid
:
376 ediPartyName
= new EDIPartyName
;
377 *ediPartyName
= *that
.ediPartyName
;
379 case uniformResourceIdentifierCid
:
380 uniformResourceIdentifier
= new IA5String
;
381 *uniformResourceIdentifier
= *that
.uniformResourceIdentifier
;
384 iPAddress
= new AsnOcts
;
385 *iPAddress
= *that
.iPAddress
;
387 case registeredIDCid
:
388 registeredID
= new AsnOid
;
389 *registeredID
= *that
.registeredID
;
395 #else // SNACC_DEEP_COPY
396 Asn1Error
<< "use of incompletely defined GeneralName &GeneralName::operator = (const GeneralName &)" << endl
;
398 // if your compiler complains here, check the -novolat option
399 #endif // SNACC_DEEP_COPY
403 GeneralName::BEncContent (BUF_TYPE b
)
409 l
= otherName
->BEncContent (b
);
410 l
+= BEncDefLen (b
, l
);
412 l
+= BEncTag1 (b
, CNTX
, PRIM
, 0);
416 l
= rfc822Name
->BEncContent (b
);
417 l
+= BEncDefLen (b
, l
);
419 l
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
423 l
= dNSName
->BEncContent (b
);
424 l
+= BEncDefLen (b
, l
);
426 l
+= BEncTag1 (b
, CNTX
, PRIM
, 2);
431 l
= x400Address
->BEncContent (b
);
432 l
+= BEncConsLen (b
, l
);
434 l
+= BEncTag1 (b
, CNTX
, CONS
, 3);
437 case directoryNameCid
:
439 l
= directoryName
->BEncContent (b
);
440 l
+= BEncConsLen (b
, l
);
442 l
+= BEncTag1 (b
, CNTX
, CONS
, 4);
445 case ediPartyNameCid
:
447 l
= ediPartyName
->BEncContent (b
);
448 l
+= BEncConsLen (b
, l
);
450 l
+= BEncTag1 (b
, CNTX
, CONS
, 5);
453 case uniformResourceIdentifierCid
:
454 l
= uniformResourceIdentifier
->BEncContent (b
);
455 l
+= BEncDefLen (b
, l
);
457 l
+= BEncTag1 (b
, CNTX
, PRIM
, 6);
461 l
= iPAddress
->BEncContent (b
);
462 l
+= BEncDefLen (b
, l
);
464 l
+= BEncTag1 (b
, CNTX
, PRIM
, 7);
467 case registeredIDCid
:
468 l
= registeredID
->BEncContent (b
);
469 l
+= BEncDefLen (b
, l
);
471 l
+= BEncTag1 (b
, CNTX
, PRIM
, 8);
476 } // GeneralName::BEncContent
479 void GeneralName::BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen0
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
484 case MAKE_TAG_ID (CNTX
, PRIM
, 0):
485 choiceId
= otherNameCid
;
486 otherName
= new OTHER_NAME
;
487 otherName
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
490 case MAKE_TAG_ID (CNTX
, PRIM
, 1):
491 case MAKE_TAG_ID (CNTX
, CONS
, 1):
492 choiceId
= rfc822NameCid
;
493 rfc822Name
= new IA5String
;
494 rfc822Name
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
497 case MAKE_TAG_ID (CNTX
, PRIM
, 2):
498 case MAKE_TAG_ID (CNTX
, CONS
, 2):
499 choiceId
= dNSNameCid
;
500 dNSName
= new IA5String
;
501 dNSName
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
504 case MAKE_TAG_ID (CNTX
, CONS
, 3):
505 choiceId
= x400AddressCid
;
506 x400Address
= new ORAddress
;
507 x400Address
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
510 case MAKE_TAG_ID (CNTX
, CONS
, 4):
511 tag
= BDecTag (b
, bytesDecoded
, env
);
512 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
513 choiceId
= directoryNameCid
;
514 directoryName
= new Name
;
515 directoryName
->BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
516 if (elmtLen0
== INDEFINITE_LEN
)
517 BDecEoc (b
, bytesDecoded
, env
);
520 case MAKE_TAG_ID (CNTX
, CONS
, 5):
521 choiceId
= ediPartyNameCid
;
522 ediPartyName
= new EDIPartyName
;
523 ediPartyName
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
526 case MAKE_TAG_ID (CNTX
, PRIM
, 6):
527 case MAKE_TAG_ID (CNTX
, CONS
, 6):
528 choiceId
= uniformResourceIdentifierCid
;
529 uniformResourceIdentifier
= new IA5String
;
530 uniformResourceIdentifier
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
533 case MAKE_TAG_ID (CNTX
, PRIM
, 7):
534 case MAKE_TAG_ID (CNTX
, CONS
, 7):
535 choiceId
= iPAddressCid
;
536 iPAddress
= new AsnOcts
;
537 iPAddress
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
540 case MAKE_TAG_ID (CNTX
, PRIM
, 8):
541 choiceId
= registeredIDCid
;
542 registeredID
= new AsnOid
;
543 registeredID
->BDecContent (b
, tag
, elmtLen0
, bytesDecoded
, env
);
547 Asn1Error
<< "ERROR - unexpected tag in CHOICE" << endl
;
548 SnaccExcep::throwMe(-103);
551 } // GeneralName::BDecContent
554 AsnLen
GeneralName::BEnc (BUF_TYPE b
)
561 void GeneralName::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
566 /* CHOICEs are a special case - grab identifying tag */
567 /* this allows easier handling of nested CHOICEs */
568 tag
= BDecTag (b
, bytesDecoded
, env
);
569 elmtLen
= BDecLen (b
, bytesDecoded
, env
);
570 BDecContent (b
, tag
, elmtLen
, bytesDecoded
, env
);
573 void GeneralName::Print (ostream
&os
) const
583 os
<< "-- void3 --\n";
591 os
<< "-- void3 --\n";
599 os
<< "-- void3 --\n";
603 os
<< "x400Address ";
607 os
<< "-- void3 --\n";
610 case directoryNameCid
:
611 os
<< "directoryName ";
613 os
<< *directoryName
;
615 os
<< "-- void3 --\n";
618 case ediPartyNameCid
:
619 os
<< "ediPartyName ";
623 os
<< "-- void3 --\n";
626 case uniformResourceIdentifierCid
:
627 os
<< "uniformResourceIdentifier ";
628 if (uniformResourceIdentifier
)
629 os
<< *uniformResourceIdentifier
;
631 os
<< "-- void3 --\n";
639 os
<< "-- void3 --\n";
642 case registeredIDCid
:
643 os
<< "registeredID ";
647 os
<< "-- void3 --\n";
652 } // GeneralName::Print
654 AsnType
*GeneralNames::Clone() const
656 return new GeneralNames
;
659 AsnType
*GeneralNames::Copy() const
661 return new GeneralNames (*this);
664 AsnLen
GeneralNames::BEnc (BUF_TYPE b
)
668 l
+= BEncConsLen (b
, l
);
669 l
+= BEncTag1 (b
, UNIV
, CONS
, SEQ_TAG_CODE
);
673 void GeneralNames::BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
)
678 if ((tag
= BDecTag (b
, bytesDecoded
, env
)) != MAKE_TAG_ID (UNIV
, CONS
, SEQ_TAG_CODE
))
680 Asn1Error
<< "GeneralNames::BDec: ERROR - wrong tag" << endl
;
681 SnaccExcep::throwMe(-104);
683 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
684 BDecContent (b
, tag
, elmtLen1
, bytesDecoded
, env
);
687 GeneralNames::GeneralNames (const GeneralNames
&)
689 Asn1Error
<< "use of incompletely defined GeneralNames::GeneralNames (const GeneralNames &)" << endl
;
693 GeneralNames::~GeneralNames()
696 for (; Curr() != NULL
; RemoveCurrFromList())
698 } // end of destructor
701 GeneralNames
&GeneralNames::operator = (const GeneralNames
&that
)
702 #else // SNACC_DEEP_COPY
703 GeneralNames
&GeneralNames::operator = (const GeneralNames
&)
704 #endif // SNACC_DEEP_COPY
710 for (; Curr(); RemoveCurrFromList())
713 //that.SetCurrToFirst();
714 //for (; that.Curr(); that.GoNext())
715 // AppendCopy (*that.Curr());
716 for (const AsnListElmt
*run
=that
.first
; run
; run
=run
->next
)
717 AppendCopy (*run
->elmt
);
721 #else // SNACC_DEEP_COPY
722 Asn1Error
<< "use of incompletely defined GeneralNames &GeneralNames::operator = (const GeneralNames &)" << endl
;
724 // if your compiler complains here, check the -novolat option
725 #endif // SNACC_DEEP_COPY
728 void GeneralNames::Print (ostream
&os
) const
731 os
<< "{ -- SEQUENCE/SET OF -- " << endl
;
732 indentG
+= stdIndentG
;
734 //for (; Curr() != NULL; GoNext())
735 for (const AsnListElmt
*run
=first
; run
; run
=run
->next
)
737 Indent (os
, indentG
);
740 //if (Curr() != Last())
745 indentG
-= stdIndentG
;
746 Indent (os
, indentG
);
754 void GeneralNames::SetCurrElmt (unsigned long int index
)
759 for (i
= 0; (i
< (count
-1)) && (i
< index
); i
++)
761 } // GeneralNames::SetCurrElmt
764 unsigned long int GeneralNames::GetCurrElmtIndex()
770 for (i
= 0, tmp
= first
; tmp
!= NULL
; i
++)
779 } // GeneralNames::GetCurrElmtIndex
782 // alloc new list elmt, put at end of list
783 // and return the component type
784 GeneralName
*GeneralNames::Append()
786 AsnListElmt
*newElmt
;
787 newElmt
= new AsnListElmt
;
788 newElmt
->elmt
= new GeneralName
;
789 newElmt
->next
= NULL
;
792 newElmt
->prev
= NULL
;
793 first
= last
= newElmt
;
797 newElmt
->prev
= last
;
798 last
->next
= newElmt
;
802 return (curr
= newElmt
)->elmt
;
803 } // GeneralNames::Append
806 // alloc new list elmt, put at begining of list
807 // and return the component type
808 GeneralName
*GeneralNames::Prepend()
810 AsnListElmt
*newElmt
;
811 newElmt
= new AsnListElmt
;
812 newElmt
->elmt
= new GeneralName
;
813 newElmt
->prev
= NULL
;
816 newElmt
->next
= NULL
;
817 first
= last
= newElmt
;
821 newElmt
->next
= first
;
822 first
->prev
= newElmt
;
826 return (curr
= newElmt
)->elmt
;
827 } // GeneralNames::Prepend
830 // alloc new list elmt, insert it before the
831 // current element and return the component type
832 // if the current element is null, the new element
833 // is placed at the beginning of the list.
834 GeneralName
*GeneralNames::InsertBefore()
836 AsnListElmt
*newElmt
;
837 newElmt
= new AsnListElmt
;
838 newElmt
->elmt
= new GeneralName
;
841 newElmt
->next
= first
;
842 newElmt
->prev
= NULL
;
849 newElmt
->next
= curr
;
850 newElmt
->prev
= curr
->prev
;
851 curr
->prev
= newElmt
;
855 newElmt
->prev
->next
= newElmt
;
858 return (curr
= newElmt
)->elmt
;
859 } // GeneralNames::InsertBefore
862 // alloc new list elmt, insert it after the
863 // current element and return the component type
864 // if the current element is null, the new element
865 // is placed at the end of the list.
866 GeneralName
*GeneralNames::InsertAfter()
868 AsnListElmt
*newElmt
;
869 newElmt
= new AsnListElmt
;
870 newElmt
->elmt
= new GeneralName
;
873 newElmt
->prev
= last
;
874 newElmt
->next
= NULL
;
881 newElmt
->prev
= curr
;
882 newElmt
->next
= curr
->next
;
883 curr
->next
= newElmt
;
887 newElmt
->next
->prev
= newElmt
;
890 return (curr
= newElmt
)->elmt
;
891 } // GeneralNames::InsertAfter
894 GeneralNames
&GeneralNames::AppendCopy (GeneralName
&elmt
)
896 AsnListElmt
*newElmt
;
897 newElmt
= new AsnListElmt
;
898 newElmt
->elmt
= new GeneralName
;
899 *newElmt
->elmt
= elmt
;
900 newElmt
->next
= NULL
;
903 newElmt
->prev
= NULL
;
904 first
= last
= newElmt
;
908 newElmt
->prev
= last
;
909 last
->next
= newElmt
;
917 GeneralNames
&GeneralNames::PrependCopy (GeneralName
&elmt
)
919 AsnListElmt
*newElmt
;
920 newElmt
= new AsnListElmt
;
921 newElmt
->elmt
= new GeneralName
;
922 *newElmt
->elmt
= elmt
;
923 newElmt
->prev
= NULL
;
926 newElmt
->next
= NULL
;
927 first
= last
= newElmt
;
931 newElmt
->next
= first
;
932 first
->prev
= newElmt
;
937 } // GeneralNames::PrependCopy
940 // alloc new list elmt, insert it before the
941 // current element, copy the given elmt into the new elmt
942 // and return the component type.
943 // if the current element is null, the new element
944 // is placed at the beginning of the list.
945 GeneralNames
&GeneralNames::InsertBeforeAndCopy (GeneralName
&elmt
)
947 AsnListElmt
*newElmt
;
949 newElmt
= new AsnListElmt
;
950 newElmt
->elmt
= new GeneralName
;
951 *newElmt
->elmt
= elmt
;
955 newElmt
->next
= first
;
956 newElmt
->prev
= NULL
;
963 newElmt
->next
= curr
;
964 newElmt
->prev
= curr
->prev
;
965 curr
->prev
= newElmt
;
969 newElmt
->prev
->next
= newElmt
;
973 } // GeneralNames::InsertBeforeAndCopy
976 // alloc new list elmt, insert it after the
977 // current element, copy given elmt in to new elmt
978 // and return the component type
979 // if the current element is null, the new element
980 // is placed at the end of the list.
981 GeneralNames
&GeneralNames::InsertAfterAndCopy (GeneralName
&elmt
)
983 AsnListElmt
*newElmt
;
985 newElmt
= new AsnListElmt
;
986 newElmt
->elmt
= new GeneralName
;
987 *newElmt
->elmt
= elmt
;
990 newElmt
->prev
= last
;
991 newElmt
->next
= NULL
;
998 newElmt
->prev
= curr
;
999 newElmt
->next
= curr
->next
;
1000 curr
->next
= newElmt
;
1004 newElmt
->next
->prev
= newElmt
;
1008 } // GeneralNames::InsertAfterAndCopy
1011 // remove current element from list if current element is not NULL
1012 // The new current element will be the next element.
1013 // If the current element is the last element in the list
1014 // the second but last element will become the new current element.
1015 void GeneralNames::RemoveCurrFromList()
1017 AsnListElmt
*del_elmt
;
1025 first
= last
= curr
= NULL
;
1026 else if (curr
== first
)
1028 curr
= first
= first
->next
;
1031 else if (curr
== last
)
1033 curr
= last
= last
->prev
;
1038 curr
->prev
->next
= curr
->next
;
1039 curr
->next
->prev
= curr
->prev
;
1042 delete del_elmt
->elmt
;
1048 AsnLen
GeneralNames::BEncContent (BUF_TYPE b
)
1050 AsnListElmt
*currElmt
;
1052 AsnLen totalLen
= 0;
1053 for (currElmt
= last
; currElmt
!= NULL
; currElmt
= currElmt
->prev
)
1055 elmtLen
= currElmt
->elmt
->BEncContent (b
);
1056 totalLen
+= elmtLen
;
1059 } // GeneralNames::BEncContent
1062 void GeneralNames::BDecContent (BUF_TYPE b
, AsnTag
/*tag0*/, AsnLen elmtLen0
,
1063 AsnLen
&bytesDecoded
, ENV_TYPE env
)
1065 GeneralName
*listElmt
;
1067 AsnLen listBytesDecoded
= 0;
1070 while ((listBytesDecoded
< elmtLen0
) || (elmtLen0
== INDEFINITE_LEN
))
1072 tag1
= BDecTag (b
, listBytesDecoded
, env
);
1073 if ((tag1
== EOC_TAG_ID
) && (elmtLen0
== INDEFINITE_LEN
))
1075 BDEC_2ND_EOC_OCTET (b
, listBytesDecoded
, env
);
1078 if (!((tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 0))
1079 || (tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))
1080 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 1))
1082 || (tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 2))
1083 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 2))
1085 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 3))
1086 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 4))
1087 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 5))
1088 || (tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 6))
1089 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 6))
1091 || (tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 7))
1092 || (tag1
== MAKE_TAG_ID (CNTX
, CONS
, 7))
1094 || (tag1
== MAKE_TAG_ID (CNTX
, PRIM
, 8))))
1096 Asn1Error
<< "Unexpected Tag" << endl
;
1097 SnaccExcep::throwMe(-105);
1100 elmtLen1
= BDecLen (b
, listBytesDecoded
, env
);
1101 listElmt
= Append();
1102 listElmt
->BDecContent (b
, tag1
, elmtLen1
, listBytesDecoded
, env
);
1105 bytesDecoded
+= listBytesDecoded
;
1106 } // GeneralNames::BDecContent