1 // NOTE: this is a machine generated file--editing not recommended
3 // sm_x509cmn.h - class definitions for ASN.1 module CommonX509Definitions
5 // This file was generated by snacc on Mon Apr 22 22:34:19 2002
6 // UBC snacc by Mike Sample
7 // A couple of enhancements made by IBM European Networking Center
10 #define _sm_x509cmn_h_
13 //------------------------------------------------------------------------------
14 // class declarations:
20 //------------------------------------------------------------------------------
23 /* OBJECT IDENTIFIER */
24 typedef AsnOid OTHER_NAME
;
26 class EDIPartyName
: public AsnType
29 DirectoryString
*nameAssigner
;
30 DirectoryString
*partyName
;
33 EDIPartyName (const EDIPartyName
&);
34 virtual ~EDIPartyName();
35 virtual AsnType
*Clone() const;
37 virtual AsnType
*Copy() const;
39 EDIPartyName
&operator = (const EDIPartyName
&);
40 AsnLen
BEncContent (BUF_TYPE b
);
41 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
43 AsnLen
BEnc (BUF_TYPE b
);
44 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
45 void Print (ostream
&os
) const;
49 class GeneralName
: public AsnType
60 uniformResourceIdentifierCid
= 6,
65 enum ChoiceIdEnum choiceId
;
68 OTHER_NAME
*otherName
;
69 IA5String
*rfc822Name
;
71 ORAddress
*x400Address
;
73 EDIPartyName
*ediPartyName
;
74 IA5String
*uniformResourceIdentifier
;
81 GeneralName (const GeneralName
&);
82 virtual ~GeneralName();
84 virtual AsnType
*Clone() const;
86 virtual AsnType
*Copy() const;
88 GeneralName
&operator = (const GeneralName
&);
89 AsnLen
BEncContent (BUF_TYPE b
);
90 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
91 AsnLen
BEnc (BUF_TYPE b
);
92 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
93 void Print (ostream
&os
) const;
97 class GeneralNames
: public AsnType
100 unsigned long int count
;
106 } *first
, *curr
, *last
;
109 GeneralNames() { count
= 0; first
= curr
= last
= NULL
; }
110 GeneralNames (const GeneralNames
&);
111 virtual ~GeneralNames();
112 virtual AsnType
*Clone() const;
114 virtual AsnType
*Copy() const;
116 GeneralNames
&operator = (const GeneralNames
&);
117 void SetCurrElmt (unsigned long int index
);
118 unsigned long int GetCurrElmtIndex();
119 void SetCurrToFirst() { curr
= first
; }
120 void SetCurrToLast() { curr
= last
; }
121 // reading member fcns
122 int Count() const { return count
; }
123 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
124 GeneralName
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
125 GeneralName
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
126 GeneralName
*Curr() const { return curr
? curr
->elmt
: NULL
; }
127 GeneralName
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
128 GeneralName
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
130 // routines that move the curr elmt
131 GeneralName
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
132 GeneralName
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
134 // write & alloc fcns - returns new elmt
135 GeneralName
*Append(); // add elmt to end of list
136 GeneralName
*Prepend(); // add elmt to beginning of list
137 GeneralName
*InsertBefore(); //insert elmt before current elmt
138 GeneralName
*InsertAfter(); //insert elmt after current elmt
140 // write & alloc & copy - returns list after copying elmt
141 GeneralNames
&AppendCopy (GeneralName
&elmt
); // add elmt to end of list
142 GeneralNames
&PrependCopy (GeneralName
&elmt
); // add elmt to beginning of list
143 GeneralNames
&InsertBeforeAndCopy (GeneralName
&elmt
); //insert elmt before current elmt
144 GeneralNames
&InsertAfterAndCopy (GeneralName
&elmt
); //insert elmt after current elmt
146 // removing the current elmt from the list
147 void RemoveCurrFromList();
149 // encode and decode routines
150 AsnLen
BEnc (BUF_TYPE b
);
151 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
152 AsnLen
BEncContent (BUF_TYPE b
);
153 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
156 void Print (ostream
&os
) const;
160 //------------------------------------------------------------------------------
161 // externs for value defs
163 //------------------------------------------------------------------------------
165 #endif /* conditional include of sm_x509cmn.h */