SecEncodeTransform.h
1 #ifndef __SECENCODETRANSFORM_H__ 2 #define __SECENCODETRANSFORM_H__ 3 4 /* 5 * Copyright (c) 2010-2011 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 <Security/SecTransform.h> 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 CF_ASSUME_NONNULL_BEGIN 34 CF_IMPLICIT_BRIDGING_ENABLED 35 36 /*! 37 @abstract Specifies a base 64 encoding 38 */ 39 extern const CFStringRef kSecBase64Encoding; 40 41 /*! 42 @abstract Specifies a base 32 encoding 43 */ 44 extern const CFStringRef kSecBase32Encoding; 45 46 /*! 47 @abstract Specifies a compressed encoding. 48 */ 49 extern const CFStringRef kSecZLibEncoding; 50 51 /*! 52 @constant kSecEncodeTypeAttribute 53 Used with SecTransformGetAttribute to query the attribute type. 54 Returns one of the strings defined in the previous section. 55 */ 56 57 extern const CFStringRef kSecEncodeTypeAttribute; 58 59 60 extern const CFStringRef kSecLineLength64; 61 extern const CFStringRef kSecLineLength76; 62 63 /*! 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). 70 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. 78 */ 79 extern const CFStringRef kSecEncodeLineLengthAttribute; 80 81 extern const CFStringRef kSecCompressionRatio; 82 83 /*! 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 95 occurred. 96 @discussion This function creates a transform which computes an 97 encode. 98 */ 99 100 // See SecDecodeTransformCreate for decoding... 101 __nullable 102 SecTransformRef SecEncodeTransformCreate(CFTypeRef encodeType, 103 CFErrorRef* error 104 ) 105 __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_NA); 106 107 CF_IMPLICIT_BRIDGING_DISABLED 108 CF_ASSUME_NONNULL_END 109 110 #ifdef __cplusplus 111 } 112 #endif 113 114 115 #endif