1 #ifndef __SECENCODETRANSFORM_H__
2 #define __SECENCODETRANSFORM_H__
5 * Copyright (c) 2010-2011 Apple Inc. All Rights Reserved.
7 * @APPLE_LICENSE_HEADER_START@
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
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.
24 * @APPLE_LICENSE_HEADER_END@
27 #include <Security/SecTransform.h>
33 CF_ASSUME_NONNULL_BEGIN
34 CF_IMPLICIT_BRIDGING_ENABLED
37 @abstract Specifies a base 64 encoding
39 extern const CFStringRef kSecBase64Encoding
;
42 @abstract Specifies a base 32 encoding
44 extern const CFStringRef kSecBase32Encoding
;
47 @abstract Specifies a compressed encoding.
49 extern const CFStringRef kSecZLibEncoding
;
52 @constant kSecEncodeTypeAttribute
53 Used with SecTransformGetAttribute to query the attribute type.
54 Returns one of the strings defined in the previous section.
57 extern const CFStringRef kSecEncodeTypeAttribute
;
60 extern const CFStringRef kSecLineLength64
;
61 extern const CFStringRef kSecLineLength76
;
64 @constant kSecEncodeLineLengthAttribute
65 Used with SecTransformSetAttribute to set the length
66 of encoded Base32 or Base64 lines. Some systems will
67 not decode or otherwise deal with excessively long lines,
68 or may be defined to limit lines to specific lengths
69 (for example RFC1421 - 64, and RFC2045 - 76).
71 The LineLengthAttribute may be set to any positive
72 value (via a CFNumberRef) to limit to a specific
73 length (values smaller then X for Base32 or Y for Base64
74 are assume to be X or Y), or to zero for no specific
75 limit. Either of the string constants kSecLineLength64
76 (RFC1421), or kSecLineLength76 (RFC2045) may be used to
77 set line lengths of 64 or 76 bytes.
79 extern const CFStringRef kSecEncodeLineLengthAttribute
;
81 extern const CFStringRef kSecCompressionRatio
;
84 @function SecEncodeTransformCreate
85 @abstract Creates an encode computation object.
86 @param encodeType The type of encoding to compute. You may pass NULL
87 for this parameter, in which case an appropriate
88 algorithm will be chosen for you.
89 @param error A pointer to a CFErrorRef. This pointer will be set
90 if an error occurred. This value may be NULL if you
91 do not want an error returned.
92 @result A pointer to a SecTransformRef object. This object must
93 be released with CFRelease when you are done with
94 it. This function will return NULL if an error
96 @discussion This function creates a transform which computes an
100 // See SecDecodeTransformCreate for decoding...
102 SecTransformRef
SecEncodeTransformCreate(CFTypeRef encodeType
,
105 __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_NA
);
107 CF_IMPLICIT_BRIDGING_DISABLED
108 CF_ASSUME_NONNULL_END