Unleashed v1.4
[unleashed.git] / share / man / man3sasl / sasl_encode64.3sasl
blob603856705b293fb1c2e89b41192388764b9e6656
1 '\" te
2 .\" Copyright (C) 1998-2003, Carnegie Mellon Univeristy.  All Rights Reserved.
3 .\" Portions Copyright (C) 2003, Sun Microsystems,
4 .\" Inc. All Rights Reserved
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH SASL_ENCODE64 3SASL "Sep 16, 2003"
9 .SH NAME
10 sasl_encode64 \- encode base64 string
11 .SH SYNOPSIS
12 .LP
13 .nf
14 \fBcc\fR [ \fIflag\fR ... ] \fIfile\fR ... \fB-lsasl\fR   [ \fIlibrary\fR ... ]
15 #include <sasl/saslutil.h>
17 \fBint\fR \fBsasl_encode64\fR(\fBconst char *\fR\fIin\fR, \fBunsigned\fR \fIinlen\fR, \fBchar *\fR\fIout\fR,
18      \fBunsigned\fR \fIoutmax\fR, \fBunsigned *\fR\fIoutlen\fR);
19 .fi
21 .SH DESCRIPTION
22 .sp
23 .LP
24 Use the \fBsasl_encode64()\fR interface to convert an octet string into a
25 base64 string. This routine is useful for SASL profiles that use base64, such
26 as the IMAP (IMAP4) and POP (POP_AUTH) profiles. The output is null-terminated.
27 If \fIoutlen\fR is non-\fINULL\fR, the length is placed in the \fIoutlen\fR.
28 .SH PARAMETERS
29 .sp
30 .ne 2
31 .na
32 \fB\fIin\fR\fR
33 .ad
34 .RS 10n
35 Input data.
36 .RE
38 .sp
39 .ne 2
40 .na
41 \fB\fIinlen\fR\fR
42 .ad
43 .RS 10n
44 The length of the input data.
45 .RE
47 .sp
48 .ne 2
49 .na
50 \fB\fIout\fR\fR
51 .ad
52 .RS 10n
53 The output data. The value of \fIout\fR can be the same as \fIin\fR. However,
54 there must be enough space.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fIoutlen\fR\fR
61 .ad
62 .RS 10n
63 The length of the actual output.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fIoutmax\fR\fR
70 .ad
71 .RS 10n
72 The maximum size of the output buffer.
73 .RE
75 .SH RETURN VALUES
76 .sp
77 .LP
78 \fBsasl_encode64()\fR returns an integer that corresponds to a SASL error code.
79 .SH ERRORS
80 .sp
81 .ne 2
82 .na
83 \fB\fBSASL_OK\fR\fR
84 .ad
85 .RS 16n
86 The call to \fBsasl_encode64()\fR was successful.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fBSASL_BUFOVER\fR\fR
93 .ad
94 .RS 16n
95 The output buffer was too small.
96 .RE
98 .SH ATTRIBUTES
99 .sp
101 See \fBattributes\fR(5) for descriptions of the following attributes:
106 box;
107 c | c
108 l | l .
109 ATTRIBUTE TYPE  ATTRIBUTE VALUE
111 Interface Stability     Evolving
113 MT-Level        MT-Safe
116 .SH SEE ALSO
119 \fBsasl_errors\fR(3SASL), \fBattributes\fR(5)