]> git.saurik.com Git - apple/security.git/blame - libsecurity_transform/lib/SecEncodeTransform.h
Security-55471.14.18.tar.gz
[apple/security.git] / libsecurity_transform / lib / SecEncodeTransform.h
CommitLineData
b1ab9ed8
A
1#ifndef __SECENCODETRANSFORM_H__
2#define __SECENCODETRANSFORM_H__
3
4/*
5 * Copyright (c) 2010 Apple Inc. All Rights Reserved.
6 *
7 * @APPLE_LICENSE_HEADER_START@
8 *
9 * This file contains Original Code and/or Modifications of Original Code
10 * as defined in and that are subject to the Apple Public Source License
11 * Version 2.0 (the 'License'). You may not use this file except in
12 * compliance with the License. Please obtain a copy of the License at
13 * http://www.opensource.apple.com/apsl/ and read it before using this
14 * file.
15 *
16 * The Original Code and all software distributed under the License are
17 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
18 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
19 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
21 * Please see the License for the specific language governing rights and
22 * limitations under the License.
23 *
24 * @APPLE_LICENSE_HEADER_END@
25 */
26
27#include "SecTransform.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33/*!
34 @abstract Specifies a base 64 encoding
35 */
36extern const CFStringRef kSecBase64Encoding;
37
38/*!
39 @abstract Specifies a base 32 encoding
40 */
41extern const CFStringRef kSecBase32Encoding;
42
43/*!
44 @abstract Specifies a compressed encoding.
45 */
46extern const CFStringRef kSecZLibEncoding;
47
48/*!
49 @constant kSecEncodeTypeAttribute
50 Used with SecTransformGetAttribute to query the attribute type.
51 Returns one of the strings defined in the previous section.
52 */
53
54extern const CFStringRef kSecEncodeTypeAttribute;
55
56
57extern const CFStringRef kSecLineLength64;
58extern const CFStringRef kSecLineLength76;
59
60/*!
61 @constant kSecEncodeLineLengthAttribute
62 Used with SecTransformSetAttribute to set the length
63 of encoded Base32 or Base64 lines. Some systems will
64 not decode or otherwise deal with excessively long lines,
65 or may be defined to limit lines to specific lengths
66 (for example RFC1421 - 64, and RFC2045 - 76).
67
68 The LineLengthAttribute may be set to any positive
69 value (via a CFNumberRef) to limit to a specific
70 length (values smaller then X for Base32 or Y for Base64
71 are assume to be X or Y), or to zero for no specific
72 limit. Either of the string constants kSecLineLength64
73 (RFC1421), or kSecLineLength76 (RFC2045) may be used to
74 set line lengths of 64 or 76 bytes.
75 */
76extern const CFStringRef kSecEncodeLineLengthAttribute;
77
78extern const CFStringRef kSecCompressionRatio;
79
80/*!
81 @function SecEncodeTransformCreate
82 @abstract Creates an encode computation object.
83 @param encodeType The type of digest to compute. You may pass NULL
84 for this parameter, in which case an appropriate
85 algorithm will be chosen for you.
86 @param error A pointer to a CFErrorRef. This pointer will be set
87 if an error occurred. This value may be NULL if you
88 do not want an error returned.
89 @result A pointer to a SecTransformRef object. This object must
90 be released with CFRelease when you are done with
91 it. This function will return NULL if an error
92 occurred.
93 @discussion This function creates a transform which computes an
94 encode.
95 */
96
97// See SecDecodeTransformCreate for decoding...
98
99SecTransformRef SecEncodeTransformCreate(CFTypeRef encodeType,
100 CFErrorRef* error
101 )
102__OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA);
103
104
105
106
107
108#ifdef __cplusplus
109}
110#endif
111
112
113#endif