Relicense all texi files under FDL 1.3 or later.
[bpt/emacs.git] / doc / misc / sasl.texi
CommitLineData
01c52d31
MB
1\input texinfo @c -*-texinfo-*-
2
4e3ebde2 3@setfilename ../../info/sasl
01c52d31
MB
4
5@set VERSION 0.2
6
7@dircategory Emacs
8@direntry
9* SASL: (sasl). The Emacs SASL library.
10@end direntry
11
12@settitle Emacs SASL Library @value{VERSION}
13
4e3ebde2 14@copying
01c52d31
MB
15This file describes the Emacs SASL library.
16
9c6b35b2
GM
17Copyright @copyright{} 2000, 2004, 2005, 2006, 2007, 2008
18Free Software Foundation, Inc.
01c52d31 19
4e3ebde2 20@quotation
01c52d31 21Permission is granted to copy, distribute and/or modify this document
6a2c4aec 22under the terms of the GNU Free Documentation License, Version 1.3 or
01c52d31 23any later version published by the Free Software Foundation; with no
cd5c05d2
GM
24Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
25and with the Back-Cover Texts as in (a) below. A copy of the license
26is included in the section entitled ``GNU Free Documentation License''
27in the Emacs manual.
28
29(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
30modify this GNU manual. Buying copies from the FSF supports it in
31developing GNU and promoting software freedom.''
4e3ebde2
GM
32
33This document is part of a collection distributed under the GNU Free
34Documentation License. If you want to distribute this document
35separately from the collection, you can do so by adding a copy of the
36license to the document, as described in section 6 of the license.
37@end quotation
38@end copying
01c52d31
MB
39
40@tex
41
42@titlepage
43@title Emacs SASL Library
44
45@author by Daiki Ueno
46@page
47
48@vskip 0pt plus 1filll
4e3ebde2 49@insertcopying
01c52d31
MB
50@end titlepage
51@page
52
53@end tex
54
55@node Top
56@top Emacs SASL
57This manual describes the Emacs SASL library.
58
59A common interface to share several authentication mechanisms between
60applications using different protocols.
61
62@menu
63* Overview:: What Emacs SASL library is.
64* How to use:: Adding authentication support to your applications.
65* Data types::
66* Back end drivers:: Writing your own drivers.
67* Index::
68* Function Index::
69* Variable Index::
70@end menu
71
72@node Overview
73@chapter Overview
74
75@sc{sasl} is short for @dfn{Simple Authentication and Security Layer}.
76This standard is documented in RFC2222. It provides a simple method for
77adding authentication support to various application protocols.
78
79The toplevel interface of this library is inspired by Java @sc{sasl}
80Application Program Interface. It defines an abstraction over a series
81of authentication mechanism drivers (@ref{Back end drivers}).
82
83Back end drivers are designed to be close as possible to the
84authentication mechanism. You can access the additional configuration
85information anywhere from the implementation.
86
87@node How to use
88@chapter How to use
89
90(Not yet written).
91
92To use Emacs SASL library, please evaluate following expression at the
93beginning of your application program.
94
95@lisp
96(require 'sasl)
97@end lisp
98
99If you want to check existence of sasl.el at runtime, instead you
100can list autoload settings for functions you want.
101
102@node Data types
103@chapter Data types
104
105There are three data types to be used for carrying a negotiated
106security layer---a mechanism, a client parameter and an authentication
107step.
108
109@menu
110* Mechanisms::
111* Clients::
112* Steps::
113@end menu
114
115@node Mechanisms
116@section Mechanisms
117
118A mechanism (@code{sasl-mechanism} object) is a schema of the @sc{sasl}
119authentication mechanism driver.
120
121@defvar sasl-mechanisms
122A list of mechanism names.
123@end defvar
124
125@defun sasl-find-mechanism mechanisms
126
ea597303 127Retrieve an appropriate mechanism.
01c52d31 128This function compares @var{mechanisms} and @code{sasl-mechanisms} then
ea597303 129returns appropriate @code{sasl-mechanism} object.
01c52d31
MB
130
131@example
132(let ((sasl-mechanisms '("CRAM-MD5" "DIGEST-MD5")))
133 (setq mechanism (sasl-find-mechanism server-supported-mechanisms)))
134@end example
135
136@end defun
137
138@defun sasl-mechanism-name mechanism
139Return name of mechanism, a string.
140@end defun
141
142If you want to write an authentication mechanism driver (@ref{Back end
143drivers}), use @code{sasl-make-mechanism} and modify
144@code{sasl-mechanisms} and @code{sasl-mechanism-alist} correctly.
145
146@defun sasl-make-mechanism name steps
147Allocate a @code{sasl-mechanism} object.
148This function takes two parameters---name of the mechanism, and a list
149of authentication functions.
150
151@example
152(defconst sasl-anonymous-steps
153 '(identity ;no initial response
154 sasl-anonymous-response))
155
156(put 'sasl-anonymous 'sasl-mechanism
157 (sasl-make-mechanism "ANONYMOUS" sasl-anonymous-steps))
158@end example
159
160@end defun
161
162@node Clients
163@section Clients
164
165A client (@code{sasl-client} object) initialized with four
166parameters---a mechanism, a user name, name of the service and name of
167the server.
168
169@defun sasl-make-client mechanism name service server
170Prepare a @code{sasl-client} object.
171@end defun
172
173@defun sasl-client-mechanism client
174Return the mechanism (@code{sasl-mechanism} object) of client.
175@end defun
176
177@defun sasl-client-name client
178Return the authorization name of client, a string.
179@end defun
180
181@defun sasl-client-service client
182Return the service name of client, a string.
183@end defun
184
185@defun sasl-client-server client
186Return the server name of client, a string.
187@end defun
188
189If you want to specify additional configuration properties, please use
190@code{sasl-client-set-property}.
191
192@defun sasl-client-set-property client property value
193Add the given property/value to client.
194@end defun
195
196@defun sasl-client-property client property
197Return the value of the property of client.
198@end defun
199
200@defun sasl-client-set-properties client plist
201Destructively set the properties of client.
202The second argument is the new property list.
203@end defun
204
205@defun sasl-client-properties client
206Return the whole property list of client configuration.
207@end defun
208
209@node Steps
210@section Steps
211
212A step (@code{sasl-step} object) is an abstraction of authentication
213``step'' which holds the response value and the next entry point for the
214authentication process (the latter is not accessible).
215
216@defun sasl-step-data step
217Return the data which @var{step} holds, a string.
218@end defun
219
220@defun sasl-step-set-data step data
221Store @var{data} string to @var{step}.
222@end defun
223
224To get the initial response, you should call the function
225@code{sasl-next-step} with the second argument @code{nil}.
226
227@example
228(setq name (sasl-mechanism-name mechanism))
229@end example
230
231At this point we could send the command which starts a SASL
232authentication protocol exchange. For example,
233
234@example
235(process-send-string
236 process
237 (if (sasl-step-data step) ;initial response
238 (format "AUTH %s %s\r\n" name (base64-encode-string (sasl-step-data step) t))
239 (format "AUTH %s\r\n" name)))
240@end example
241
242To go on with the authentication process, all you have to do is call
243@code{sasl-next-step} consecutively.
244
245@defun sasl-next-step client step
246Perform the authentication step.
247At the first time @var{step} should be set to @code{nil}.
248@end defun
249
250@node Back end drivers
251@chapter Back end drivers
252
253(Not yet written).
254
255@node Index
256@chapter Index
257@printindex cp
258
259@node Function Index
260@chapter Function Index
261@printindex fn
262
263@node Variable Index
264@chapter Variable Index
265@printindex vr
266
267@summarycontents
268@contents
269@bye
270
271@c End:
272
273@ignore
274 arch-tag: dc9650be-a953-40bf-bc55-24fe5f19d875
275@end ignore