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 Wed Jun 27 16:40:55 2001
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 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
46 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
48 void Print (ostream
&os
) const;
52 class GeneralName
: public AsnType
63 uniformResourceIdentifierCid
= 6,
68 enum ChoiceIdEnum choiceId
;
71 OTHER_NAME
*otherName
;
72 IA5String
*rfc822Name
;
74 ORAddress
*x400Address
;
76 EDIPartyName
*ediPartyName
;
77 IA5String
*uniformResourceIdentifier
;
84 GeneralName (const GeneralName
&);
85 virtual ~GeneralName();
87 virtual AsnType
*Clone() const;
89 virtual AsnType
*Copy() const;
91 GeneralName
&operator = (const GeneralName
&);
92 AsnLen
BEncContent (BUF_TYPE b
);
93 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
94 AsnLen
BEnc (BUF_TYPE b
);
95 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
96 int BEncPdu (BUF_TYPE b
, AsnLen
&bytesEncoded
);
97 int BDecPdu (BUF_TYPE b
, AsnLen
&bytesDecoded
);
99 void Print (ostream
&os
) const;
103 class GeneralNames
: public AsnType
106 unsigned long int count
;
112 } *first
, *curr
, *last
;
115 GeneralNames() { count
= 0; first
= curr
= last
= NULL
; }
116 GeneralNames (const GeneralNames
&);
117 virtual ~GeneralNames();
118 virtual AsnType
*Clone() const;
120 virtual AsnType
*Copy() const;
122 GeneralNames
&operator = (const GeneralNames
&);
123 void SetCurrElmt (unsigned long int index
);
124 unsigned long int GetCurrElmtIndex();
125 void SetCurrToFirst() { curr
= first
; }
126 void SetCurrToLast() { curr
= last
; }
127 // reading member fcns
128 int Count() const { return count
; }
129 // NOTE: if your compiler complains about these NULLs, its definition of NULL is broken (and you better change it there!)
130 GeneralName
*First() const { return count
> 0 ? first
->elmt
: NULL
; }
131 GeneralName
*Last() const { return count
> 0 ? last
->elmt
: NULL
; }
132 GeneralName
*Curr() const { return curr
? curr
->elmt
: NULL
; }
133 GeneralName
*Next() const { return curr
&& curr
->next
? curr
->next
->elmt
: NULL
; }
134 GeneralName
*Prev() const { return curr
&& curr
->prev
? curr
->prev
->elmt
: NULL
; }
136 // routines that move the curr elmt
137 GeneralName
*GoNext() { if (curr
) curr
= curr
->next
; return Curr(); }
138 GeneralName
*GoPrev() { if (curr
) curr
= curr
->prev
; return Curr(); }
140 // write & alloc fcns - returns new elmt
141 GeneralName
*Append(); // add elmt to end of list
142 GeneralName
*Prepend(); // add elmt to beginning of list
143 GeneralName
*InsertBefore(); //insert elmt before current elmt
144 GeneralName
*InsertAfter(); //insert elmt after current elmt
146 // write & alloc & copy - returns list after copying elmt
147 GeneralNames
&AppendCopy (GeneralName
&elmt
); // add elmt to end of list
148 GeneralNames
&PrependCopy (GeneralName
&elmt
); // add elmt to beginning of list
149 GeneralNames
&InsertBeforeAndCopy (GeneralName
&elmt
); //insert elmt before current elmt
150 GeneralNames
&InsertAfterAndCopy (GeneralName
&elmt
); //insert elmt after current elmt
152 // removing the current elmt from the list
153 void RemoveCurrFromList();
155 // encode and decode routines
156 AsnLen
BEnc (BUF_TYPE b
);
157 void BDec (BUF_TYPE b
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
158 AsnLen
BEncContent (BUF_TYPE b
);
159 void BDecContent (BUF_TYPE b
, AsnTag tag
, AsnLen elmtLen
, AsnLen
&bytesDecoded
, ENV_TYPE env
);
162 void Print (ostream
&os
) const;
166 //------------------------------------------------------------------------------
167 // externs for value defs
169 //------------------------------------------------------------------------------
171 #endif /* conditional include of sm_x509cmn.h */