]>
git.saurik.com Git - apple/security.git/blob - Security/libsecurity_apple_x509_tp/lib/cuEnc64.h
2 * Copyright (c) 1998-2003,2010-2011 Apple Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please
7 * obtain a copy of the License at http://www.apple.com/publicsource and
8 * read it before using this file.
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
12 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
13 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
14 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
15 * Please see the License for the specific language governing rights and
16 * limitations under the License.
18 * cuEnc64.h - encode/decode in 64-char IA5 format, per RFC 1421
29 * Given input buffer inbuf, length inlen, decode from 64-char IA5 format to
30 * binary. Result is malloced and returned; its length is returned in *outlen.
31 * NULL return indicates corrupted input.
33 unsigned char *cuEnc64(const unsigned char *inbuf
,
35 unsigned *outlen
); // RETURNED
38 * Enc64, with embedded newlines every lineLen in result. A newline is
39 * the UNIX \n. Result is mallocd.
41 unsigned char *cuEnc64WithLines(const unsigned char *inbuf
,
44 unsigned *outlen
); // RETURNED
47 * Given input buffer inbuf, length inlen, decode from 64-char IA5 format to
48 * binary. Result is malloced and returned; its length is returned in *outlen.
49 * NULL return indicates corrupted input. All whitespace in inbuf is
52 unsigned char *cuDec64(const unsigned char *inbuf
,
57 * Determine if specified input data is valid enc64 format. Returns 1
60 int cuIsValidEnc64(const unsigned char *inbuf
,
64 * Given input buffer containing a PEM-encoded certificate, convert to DER
65 * and return in outbuf. Result is malloced and must be freed by caller;
66 * its length is returned in *outlen. Returns 0 on success.
68 int cuConvertPem(const unsigned char *inbuf
,
70 unsigned char **outbuf
, // RETURNED (caller must free)
71 unsigned *outlen
); // RETURNED
77 #endif /*_CU_ENC64_H_*/