4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-a" />
5 <meta http-equiv="Content-Language" content="en" />
6 <meta name="description" content="SILC Secure Internet Live Conferencing" />
7 <meta name="keywords" content="SILC, secure, chat, protocol, cipher, encrypt, SKE" />
8 <meta content="INDEX, FOLLOW" name="ROBOTS" />
9 <style type="text/css">
11 body { color: #000000; background: #f0f0f0; font-family: Helvetica, Arial, Sans-serif; }
12 a:link { text-decoration: none; color: #2f488f; }
13 a:visited { text-decoration: none;color: #2f488f; }
14 a:active { text-decoration: none; color: #2f488f; }
19 <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
21 <table border="0" cellspacing="0" cellpadding="6" width="100%">
22 <tr valign="top" bgcolor="#dddddd">
23 <td><small>Copyright © 2001 - 2007 SILC Project<br />
24 <a href="http://silcnet.org">SILC Project Website</a></small></td>
25 <td align="right"><small>
26 <a href="index.html">SILC Toolkit Reference Manual</a><br />
27 <a href="toolkit_index.html">Index</a></small></td>
31 <table border="0" cellspacing="0" cellpadding="0" width="100%">
32 <tr bgcolor="#444444"><td><img src="space.gif" width="1" height="1"border="0" alt="" ></td></tr>
35 <table cellpadding="0" cellspacing="0" border="0">
38 <td width="200" bgcolor="#f0f0f0">
39 <img src="space.gif" width="1" height="1" border="0" alt="">
40 <table width="100%" cellpadding="2" cellspacing="2" border="0">
44 <!-- Template file for the big index that appears in the Toolkit reference
45 manual on the left side. With this file it is possible to add other than
46 automatically generated links to that list. -->
48 <a href="index.html"><img src="box.gif" border="0" alt="">SILC Toolkit Reference Manual</a><br />
51 <a href=silccryptlib.html><img src=box.gif border=0 alt=>SILC Crypto Library</a><br />
52 <a href=silcrng_intro.html><img src=box2.gif border=0 alt=>Introduction to SILC RNG</a><br />
53 <a href=silcrng.html><img src=box2.gif border=0 alt=>SILC RNG Interface</a><br />
54 <a href=silccipher.html><img src=box2.gif border=0 alt=>SILC Cipher API</a><br />
55 <a href=silcpkcs.html><img src=box2.gif border=0 alt=>SILC PKCS API</a><br />
56 <a href=silcpk.html><img src=box2.gif border=0 alt=>SILC Public Key API</a><br />
57 <a href=silcpkcs1.html><img src=box2.gif border=0 alt=>SILC PKCS #1 API</a><br />
58 <a href=silchash.html><img src=box2.gif border=0 alt=>SILC Hash Interface</a><br />
59 <a href=silchmac.html><img src=box2.gif border=0 alt=>SILC HMAC Interface</a><br />
60 <a href=silccorelib.html><img src=box.gif border=0 alt=>SILC Core Library</a><br />
61 <a href=silcauth.html><img src=box2.gif border=0 alt=>SILC Authentication Interface</a><br />
62 <a href=silcmessage.html><img src=box2.gif border=0 alt=>SILC Message Interface</a><br />
63 <a href=silcchannel.html><img src=box2.gif border=0 alt=>SILC Channel Interface</a><br />
64 <a href=silccommand.html><img src=box2.gif border=0 alt=>SILC Command Interface</a><br />
65 <a href=silcnotify.html><img src=box2.gif border=0 alt=>SILC Notify Interface</a><br />
66 <a href=silcstatus.html><img src=box2.gif border=0 alt=>SILC Status Types</a><br />
67 <a href=silcmode.html><img src=box2.gif border=0 alt=>SILC Modes</a><br />
68 <a href=silcid.html><img src=box2.gif border=0 alt=>SILC ID Interface</a><br />
69 <a href=silcargument.html><img src=box2.gif border=0 alt=>SILC Argument Interface</a><br />
70 <a href=silcattrs.html><img src=box2.gif border=0 alt=>SILC Attributes Interface</a><br />
71 <a href=silcpacket.html><img src=box2.gif border=0 alt=>Packet Engine Interface</a><br />
72 <a href=silcpubkey.html><img src=box2.gif border=0 alt=>SILC Public Key Payload Interface</a><br />
73 <a href=silcskelib.html><img src=box.gif border=0 alt=>SILC Key Exchange Library</a><br />
74 <a href=silcske.html><img src=box2.gif border=0 alt=>SILC SKE Interface</a><br />
75 <a href=silcconnauth.html><img src=box2.gif border=0 alt=>SILC Connection Authentication Interface</a><br />
76 <a href=silcvcardlib.html><img src=box.gif border=0 alt=>SILC VCard Library</a><br />
77 <a href=silcvcard.html><img src=box2.gif border=0 alt=>SILC VCard Interface</a><br />
78 <a href=silcmathlib.html><img src=box.gif border=0 alt=>SILC Math Library</a><br />
79 <a href=silcmp.html><img src=box2.gif border=0 alt=>SILC MP Interface</a><br />
80 <a href=silcmath.html><img src=box2.gif border=0 alt=>SILC Math Interface</a><br />
81 <a href=silcclientlib.html><img src=box.gif border=0 alt=>SILC Client Library</a><br />
82 <a href=silcclient_using.html><img src=box2.gif border=0 alt=>Using SILC Client Library Tutorial</a><br />
83 <a href=command_reply_args.html><img src=box2.gif border=0 alt=>Arguments for <b>command_reply</b> Client Operation</a><br />
84 <a href=silcstatus_args.html><img src=box2.gif border=0 alt=>SilcStatus Error Arguments in <b>command_reply</b> Client Operation</a><br />
85 <a href=notifyargs.html><img src=box2.gif border=0 alt=>Arguments for <b>notify</b> Client Operation</a><br />
86 <a href=silcclient_unicode.html><img src=box2.gif border=0 alt=>Unicode and UTF-8 Strings in Client Library</a><br />
87 <a href=silcclient.html><img src=box2.gif border=0 alt=>Client Library Interface Reference</a><br />
88 <a href=silcclient_entry.html><img src=box2.gif border=0 alt=>Client Entry Interface Reference</a><br />
89 <a href=silcasn1lib.html><img src=box.gif border=0 alt=>SILC ASN.1 Library</a><br />
90 <a href=silcasn1.html><img src=box2.gif border=0 alt=>SILC ASN.1 Interface</a><br />
91 <a href=silcber.html><img src=box2.gif border=0 alt=>SILC BER interface</a><br />
92 <a href=silchttplib.html><img src=box.gif border=0 alt=>SILC HTTP Library</a><br />
93 <a href=silchttpserver.html><img src=box2.gif border=0 alt=>SILC HTTP Server Interface</a><br />
94 <a href=silchttpphp.html><img src=box2.gif border=0 alt=>SILC HTTP PHP Translator</a><br />
95 <a href=silcutillib.html><img src=box.gif border=0 alt=>SILC Utility Library</a><br />
96 <a href=silctypes.html><img src=box2.gif border=0 alt=>Basic Types and Definitions</a><br />
97 <a href=silcbuffer.html><img src=box2.gif border=0 alt=>Data Buffer Interface</a><br />
98 <a href=silcbuffmt.html><img src=box2.gif border=0 alt=>Data Buffer Format Interface</a><br />
99 <a href=silchashtable.html><img src=box2.gif border=0 alt=>Hash Table Interface</a><br />
100 <a href=silcmemory.html><img src=box2.gif border=0 alt=>Memory Allocation Interface</a><br />
101 <a href=silcstack.html><img src=box2.gif border=0 alt=>Data Stack (memory pool) Interface</a><br />
102 <a href=silcfsm.html><img src=box2.gif border=0 alt=>Finite State Machine Interface</a><br />
103 <a href=silcthread.html><img src=box2.gif border=0 alt=>Thread Interface</a><br />
104 <a href=silcmutex.html><img src=box2.gif border=0 alt=>Mutual Exclusion Lock Interface</a><br />
105 <a href=silccond.html><img src=box2.gif border=0 alt=>Condition Variable Interface</a><br />
106 <a href=silcatomic.html><img src=box2.gif border=0 alt=>Atomic Operations Interface</a><br />
107 <a href=silcnet.html><img src=box2.gif border=0 alt=>Network (TCP and UDP) Interface</a><br />
108 <a href=silcschedule.html><img src=box2.gif border=0 alt=>Scheduler Interface</a><br />
109 <a href=silcasync.html><img src=box2.gif border=0 alt=>Asynchronous Operation Interface</a><br />
110 <a href=silcstream.html><img src=box2.gif border=0 alt=>Abstract Stream Interface</a><br />
111 <a href=silcsocketstream.html><img src=box2.gif border=0 alt=>Socket Stream Interface</a><br />
112 <a href=silcfdstream.html><img src=box2.gif border=0 alt=>File Descriptor Stream Interface</a><br />
113 <a href=silcfileutil.html><img src=box2.gif border=0 alt=>File Utility Functions</a><br />
114 <a href=silcstrutil.html><img src=box2.gif border=0 alt=>String Utility Interface</a><br />
115 <a href=silcsnprintf.html><img src=box2.gif border=0 alt=>Snprintf Interface</a><br />
116 <a href=silcutf8.html><img src=box2.gif border=0 alt=>UTF-8 String Interface</a><br />
117 <a href=silcstringprep.html><img src=box2.gif border=0 alt=>Stringprep Interface</a><br />
118 <a href=silcutil.html><img src=box2.gif border=0 alt=>Utility Functions</a><br />
119 <a href=silclist.html><img src=box2.gif border=0 alt=>List Interface</a><br />
120 <a href=silcdlist.html><img src=box2.gif border=0 alt=>Dynamic List Interface</a><br />
121 <a href=silcmime.html><img src=box2.gif border=0 alt=>MIME Interface</a><br />
122 <a href=silctime.html><img src=box2.gif border=0 alt=>Time Utility Functions</a><br />
123 <a href=silclog.html><img src=box2.gif border=0 alt=>Logging Interface</a><br />
124 <a href=silcconfig.html><img src=box2.gif border=0 alt=>Config File Interface</a><br />
125 <a href=silcskrlib.html><img src=box.gif border=0 alt=>SILC Key Repository Library</a><br />
126 <a href=silcskr.html><img src=box2.gif border=0 alt=>SILC SKR Interface</a><br />
127 <a href=silcaputillib.html><img src=box.gif border=0 alt=>SILC Application Utility Library</a><br />
128 <a href=silcapputil.html><img src=box2.gif border=0 alt=>SILC Application Utilities</a><br />
129 <a href=silcidcache.html><img src=box2.gif border=0 alt=>SILC ID Cache Interface</a><br />
130 <a href=silcsftplib.html><img src=box.gif border=0 alt=>SILC SFTP Library</a><br />
131 <a href=silcsftp.html><img src=box2.gif border=0 alt=>SILC SFTP Interface</a><br />
132 <a href=silcsftp_fs.html><img src=box2.gif border=0 alt=>SFTP Filesystems Interface</a><br />
135 <b>Resource Links</b>
137 <a href="http://silcnet.org"><img src="box.gif" border="0" alt="">SILC Project Website</a><br />
138 <a href="http://silcnet.org/support/documentation/"><img src="box.gif" border="0" alt="">SILC Protocol Documentation</a><br />
139 <a href="http://silcnet.org/support/documentation/wp/"><img src="box.gif" border="0" alt="">SILC White Paper</a><br />
140 <a href="http://silcnet.org/support/faq/"><img src="box.gif" border="0" alt="">SILC FAQs</a><br />
143 <br /><br /><br /><br />
148 <td bgcolor="#cccccc" background="dot.gif">
149 <img src="space.gif" width="1" height="1" border="0" alt=""></td>
151 <td width="720" bgcolor="#ffffff">
152 <img src="space.gif" width="1" height="1" border="0" alt="">
153 <table cellpadding="2" cellspacing="6" width="100%">
154 <tr><td valign="top">
157 <FONT SIZE="+2" COLOR="#000055"><B>Function <A NAME="silc_asn1_decode">silc_asn1_decode</A></FONT></B><BR><BR>
160 <FONT COLOR="#000055">SYNOPSIS
162 <PRE><FONT FACE="courier" size="3">
163 <A HREF="silctypes-SilcBool.html">SilcBool</A> <B>silc_asn1_decode</B>(<A HREF="silcasn1-SilcAsn1.html">SilcAsn1</A> asn1, <A HREF="silcbuffer-SilcBuffer.html">SilcBuffer</A> src, ...);
165 </FONT></PRE><FONT SIZE="+1"><B>
166 <FONT COLOR="#000055">DESCRIPTION
168 <PRE><FONT FACE="Helvetiva,Arial,Sans-serif">
169 Decodes the ASN.1 encoded buffer `src' by the ASN.1 types sent
170 as argument. The ASN.1 types sent as argument must be found from
171 the `src' for this function to decode successfully.
173 The memory allocated for the results are allocated from `asn1' and
174 they become invalid if `asn1' becomes invalid. Next (second) call
175 to this function does NOT invalidate the previous results. However,
176 third call to this function does invalidate the results of the first
177 call but not second. On the other hand, fourth call invalidates
178 the results of the second call but not third, fifth call invalidates
179 the results of the third call but not fourth, and so on. This allows
180 efficient decoding, when <B>silc_asn1_decode</B> must be called multiple times
181 to decode all data, without new memory allocations. However, caller
182 must be cautios and understand that the every second call invalidates
183 the results of every second previous results.
185 If the <A HREF="silcasn1-SILC_ASN1_OPTS.html">SILC_ASN1_OPTS</A> macro with SILC_ASN1_ALLOC option is given then
186 all results are dynamically allocated and caller must free them by
187 itself. Alternatively if SILC_ASN1_ACCUMUL is given then memory is
188 accumulated from `asn1' for results and they are freed only when the
189 <A HREF="silcasn1-silc_asn1_free.html">silc_asn1_free</A> or <A HREF="silcasn1-silc_asn1_uninit.html">silc_asn1_uninit</A> is called. Next calls to the
190 <B>silc_asn1_decode</B> will NOT invalidate the old results, but will
191 accumulate more memory for new results. If the <A HREF="silcasn1-SILC_ASN1_OPTS.html">SILC_ASN1_OPTS</A> is not
192 given at all then the default allocation method (decribed above)
195 If caller needs to store the results even after `asn1' becomes invalid
196 then call must either use SILC_ASN1_ALLOC option or duplicate the
199 </FONT></PRE><FONT SIZE="+1"><B>
200 <FONT COLOR="#000055">EXAMPLE
202 <PRE><FONT FACE="courier" size="3">
203 <A HREF="silctypes-SilcBool.html">SilcBool</A> bool_val, foo;
204 unsigned char *string, string2;
205 <A HREF="silctypes-SilcUInt32.html">SilcUInt32</A> string_len, string2_len;
207 <B>silc_asn1_decode</B>(asn1, tree,
208 <A HREF="silcasn1-SILC_ASN1_SEQUENCE.html">SILC_ASN1_SEQUENCE</A>,
209 <A HREF="silcasn1-SILC_ASN1_BOOLEAN.html">SILC_ASN1_BOOLEAN</A>(&bool_val),
210 <A HREF="silcasn1-SILC_ASN1_OCTET_STRING.html">SILC_ASN1_OCTET_STRING</A>(&string, &string_len),
211 SILC_ASN1_SEQUENCE_T(0, 2),
212 SILC_ASN1_BOOLEAN_T(SILC_ASN1_EXPLICIT, 100, &foo),
213 <A HREF="silcasn1-SILC_ASN1_END.html">SILC_ASN1_END</A>,
214 SILC_ASN1_OCTET_STRING_T(0, 1, &str2, &str2_len),
215 <A HREF="silcasn1-SILC_ASN1_END.html">SILC_ASN1_END</A>, <A HREF="silcasn1-SILC_ASN1_END.html">SILC_ASN1_END</A>);
218 <br /><br /><br /><br />
223 <td bgcolor="#cccccc" background="dot.gif">
224 <img src="space.gif" width="1" height="1" border="0" alt=""></td>
226 <td width="180" bgcolor="#f0f0f0">
227 <img src="space.gif" width="1" height="1" border="0" alt="">
228 <table width="100%" cellpadding="4" cellspacing="0">
229 <tr valign="top"><td>
231 <font face="Helvetica,Arial,Sans-serif" size="1">
232 <A HREF="silcasn1.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">ASN.1 Interface</A><BR>
233 <A HREF="silcasn1-SilcAsn1.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SilcAsn1</A><BR>
234 <A HREF="silcasn1-SilcAsn1Struct.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SilcAsn1Struct</A><BR>
235 <A HREF="silcasn1-SilcAsn1Options.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SilcAsn1Options</A><BR>
236 <A HREF="silcasn1-SilcAsn1Tag.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SilcAsn1Tag</A><BR>
237 <A HREF="silcasn1-silc_asn1_alloc.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">silc_asn1_alloc</A><BR>
238 <A HREF="silcasn1-silc_asn1_free.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">silc_asn1_free</A><BR>
239 <A HREF="silcasn1-silc_asn1_init.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">silc_asn1_init</A><BR>
240 <A HREF="silcasn1-silc_asn1_uninit.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">silc_asn1_uninit</A><BR>
241 <A HREF="silcasn1-silc_asn1_encode.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">silc_asn1_encode</A><BR>
242 <A HREF="silcasn1-silc_asn1_decode.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">silc_asn1_decode</A><BR>
243 <A HREF="silcasn1-SILC_ASN1_OPTS.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_OPTS</A><BR>
244 <A HREF="silcasn1-SILC_ASN1_ANY.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_ANY</A><BR>
245 <A HREF="silcasn1-SILC_ASN1_ANY_PRIMITIVE.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_ANY_PRIMITIVE</A><BR>
246 <A HREF="silcasn1-SILC_ASN1_SEQUENCE.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_SEQUENCE</A><BR>
247 <A HREF="silcasn1-SILC_ASN1_SET.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_SET</A><BR>
248 <A HREF="silcasn1-SILC_ASN1_SEQUENCE_OF.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_SEQUENCE_OF</A><BR>
249 <A HREF="silcasn1-SILC_ASN1_SET_OF.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_SET_OF</A><BR>
250 <A HREF="silcasn1-SILC_ASN1_CHOICE.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_CHOICE</A><BR>
251 <A HREF="silcasn1-SILC_ASN1_BOOLEAN.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_BOOLEAN</A><BR>
252 <A HREF="silcasn1-SILC_ASN1_INT.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_INT</A><BR>
253 <A HREF="silcasn1-SILC_ASN1_SHORT_INT.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_SHORT_INT</A><BR>
254 <A HREF="silcasn1-SILC_ASN1_ENUM.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_ENUM</A><BR>
255 <A HREF="silcasn1-SILC_ASN1_BIT_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_BIT_STRING</A><BR>
256 <A HREF="silcasn1-SILC_ASN1_NULL.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_NULL</A><BR>
257 <A HREF="silcasn1-SILC_ASN1_OID.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_OID</A><BR>
258 <A HREF="silcasn1-SILC_ASN1_OCTET_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_OCTET_STRING</A><BR>
259 <A HREF="silcasn1-SILC_ASN1_UTF8_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_UTF8_STRING</A><BR>
260 <A HREF="silcasn1-SILC_ASN1_NUMERIC_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_NUMERIC_STRING</A><BR>
261 <A HREF="silcasn1-SILC_ASN1_PRINTABLE_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_PRINTABLE_STRING</A><BR>
262 <A HREF="silcasn1-SILC_ASN1_TELETEX_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_TELETEX_STRING</A><BR>
263 <A HREF="silcasn1-SILC_ASN1_IA5_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_IA5_STRING</A><BR>
264 <A HREF="silcasn1-SILC_ASN1_VISIBLE_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_VISIBLE_STRING</A><BR>
265 <A HREF="silcasn1-SILC_ASN1_UNIVERSAL_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_UNIVERSAL_STRING</A><BR>
266 <A HREF="silcasn1-SILC_ASN1_BMP_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_BMP_STRING</A><BR>
267 <A HREF="silcasn1-SILC_ASN1_UNRESTRICTED_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_UNRESTRICTED_STRING</A><BR>
268 <A HREF="silcasn1-SILC_ASN1_GENERAL_STRING.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_GENERAL_STRING</A><BR>
269 <A HREF="silcasn1-SILC_ASN1_UTC_TIME.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_UTC_TIME</A><BR>
270 <A HREF="silcasn1-SILC_ASN1_GEN_TIME.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_GEN_TIME</A><BR>
271 <A HREF="silcasn1-SILC_ASN1_END.html"><IMG SRC="index_pic.gif" BORDER="0" ALT="">SILC_ASN1_END</A><BR>
274 <br /><br /><br /><br />
281 <table border="0" cellspacing="0" cellpadding="0" width="100%">
282 <tr bgcolor="#444444"><td><img src="space.gif" width="1" height="1"border="0" alt="" ></td></tr>
284 <table border="0" cellspacing="0" cellpadding="6" width="100%">
285 <tr valign="top" bgcolor="#dddddd">
286 <td><small>Copyright © 2001 - 2007 SILC Project<br />
287 <a href="http://silcnet.org">SILC Project Website</a></small></td>
288 <td align="right"><small>
289 <a href="index.html">SILC Toolkit Reference Manual</a><br />
290 <a href="toolkit_index.html">Index</a></small></td>