andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: /* andre@0: * base64.h - prototypes for base64 encoding/decoding andre@0: * Note: These functions are deprecated; see nssb64.h for new routines. andre@0: */ andre@0: #ifndef _BASE64_H_ andre@0: #define _BASE64_H_ andre@0: andre@0: #include "utilrename.h" andre@0: #include "seccomon.h" andre@0: andre@0: SEC_BEGIN_PROTOS andre@0: andre@0: /* andre@0: ** Return an PORT_Alloc'd ascii string which is the base64 encoded andre@0: ** version of the input string. andre@0: */ andre@0: extern char *BTOA_DataToAscii(const unsigned char *data, unsigned int len); andre@0: andre@0: /* andre@0: ** Return an PORT_Alloc'd string which is the base64 decoded version andre@0: ** of the input string; set *lenp to the length of the returned data. andre@0: */ andre@0: extern unsigned char *ATOB_AsciiToData(const char *string, unsigned int *lenp); andre@0: andre@0: /* andre@0: ** Convert from ascii to binary encoding of an item. andre@0: */ andre@0: extern SECStatus ATOB_ConvertAsciiToItem(SECItem *binary_item, const char *ascii); andre@0: andre@0: /* andre@0: ** Convert from binary encoding of an item to ascii. andre@0: */ andre@0: extern char *BTOA_ConvertItemToAscii(SECItem *binary_item); andre@0: andre@0: SEC_END_PROTOS andre@0: andre@0: #endif /* _BASE64_H_ */