1 #ifndef __SECENCODETRANSFORM_H__
2 #define __SECENCODETRANSFORM_H__
5 * Copyright (c) 2010 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 "SecTransform.h"
34 @abstract Specifies a base 64 encoding
36 extern const CFStringRef kSecBase64Encoding
;
39 @abstract Specifies a base 32 encoding
41 extern const CFStringRef kSecBase32Encoding
;
44 @abstract Specifies a compressed encoding.
46 extern const CFStringRef kSecZLibEncoding
;
49 @constant kSecEncodeTypeAttribute
50 Used with SecTransformGetAttribute to query the attribute type.
51 Returns one of the strings defined in the previous section.
54 extern const CFStringRef kSecEncodeTypeAttribute
;
57 extern const CFStringRef kSecLineLength64
;
58 extern const CFStringRef kSecLineLength76
;
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).
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.
76 extern const CFStringRef kSecEncodeLineLengthAttribute
;
78 extern const CFStringRef kSecCompressionRatio
;
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
93 @discussion This function creates a transform which computes an
97 // See SecDecodeTransformCreate for decoding...
99 SecTransformRef
SecEncodeTransformCreate(CFTypeRef encodeType
,
102 __OSX_AVAILABLE_STARTING(__MAC_10_7
,__IPHONE_NA
);