2 * Unix SMB/CIFS implementation.
3 * Samba utility functions
5 * Copyright (C) Andrew Tridgell 1992-2001
6 * Copyright (C) Simo Sorce 2001-2002
7 * Copyright (C) Martin Pool 2003
8 * Copyright (C) James Peach 2006
9 * Copyright (C) Jeremy Allison 1992-2007
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef __LIB_UTIL_BASE64_H__
26 #define __LIB_UTIL_BASE64_H__
29 #include "lib/util/data_blob.h"
32 Base64 decode a string, place into a data blob. Caller to
33 data_blob_free() the result.
35 DATA_BLOB
base64_decode_data_blob_talloc(TALLOC_CTX
*mem_ctx
, const char *s
);
38 Base64 decode a string, place into a data blob on NULL context.
39 Caller to data_blob_free() the result.
41 DATA_BLOB
base64_decode_data_blob(const char *s
);
44 Base64 decode a string, inplace
46 void base64_decode_inplace(char *s
);
48 Base64 encode a binary data blob into a string
50 char *base64_encode_data_blob(TALLOC_CTX
*mem_ctx
, DATA_BLOB data
);