]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cssm/lib/cssmkrapi.h
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / libsecurity_cssm / lib / cssmkrapi.h
1 /*
2 * Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 *
23 * cssmkrapi.h -- Application Programmers Interface for Key Recovery Modules
24 */
25
26 #ifndef _CSSMKRAPI_H_
27 #define _CSSMKRAPI_H_ 1
28
29 #include <Security/cssmtype.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #pragma clang diagnostic push
36 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
37
38 typedef uint32 CSSM_KRSP_HANDLE; /* Key Recovery Service Provider Handle */
39
40 typedef struct cssm_kr_name {
41 uint8 Type; /* namespace type */
42 uint8 Length; /* name string length */
43 char *Name; /* name string */
44 } CSSM_KR_NAME DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
45
46 typedef struct cssm_kr_profile {
47 CSSM_KR_NAME UserName; /* name of the user */
48 CSSM_CERTGROUP_PTR UserCertificate; /* public key certificate of the user */
49 CSSM_CERTGROUP_PTR KRSCertChain; /* cert chain for the KRSP coordinator */
50 uint8 LE_KRANum; /* number of KRA cert chains in the following list */
51 CSSM_CERTGROUP_PTR LE_KRACertChainList; /* list of Law enforcement KRA certificate chains */
52 uint8 ENT_KRANum; /* number of KRA cert chains in the following list */
53 CSSM_CERTGROUP_PTR ENT_KRACertChainList; /* list of Enterprise KRA certificate chains */
54 uint8 INDIV_KRANum; /* number of KRA cert chains in the following list */
55 CSSM_CERTGROUP_PTR INDIV_KRACertChainList; /* list of Individual KRA certificate chains */
56 CSSM_DATA_PTR INDIV_AuthenticationInfo; /* authentication information for individual key recovery */
57 uint32 KRSPFlags; /* flag values to be interpreted by KRSP */
58 CSSM_DATA_PTR KRSPExtensions; /* reserved for extensions specific to KRSPs */
59 } CSSM_KR_PROFILE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_PROFILE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
60
61 typedef struct cssm_kr_wrappedproductinfo {
62 CSSM_VERSION StandardVersion;
63 CSSM_STRING StandardDescription;
64 CSSM_VERSION ProductVersion;
65 CSSM_STRING ProductDescription;
66 CSSM_STRING ProductVendor;
67 uint32 ProductFlags;
68 } CSSM_KR_WRAPPEDPRODUCT_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_WRAPPEDPRODUCT_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
69
70 typedef struct cssm_krsubservice {
71 uint32 SubServiceId;
72 char *Description; /* Description of this sub service */
73 CSSM_KR_WRAPPEDPRODUCT_INFO WrappedProduct;
74 } CSSM_KRSUBSERVICE, *CSSM_KRSUBSERVICE_PTR;
75
76 typedef uint32 CSSM_KR_POLICY_TYPE;
77 #define CSSM_KR_INDIV_POLICY (0x00000001)
78 #define CSSM_KR_ENT_POLICY (0x00000002)
79 #define CSSM_KR_LE_MAN_POLICY (0x00000003)
80 #define CSSM_KR_LE_USE_POLICY (0x00000004)
81
82 typedef uint32 CSSM_KR_POLICY_FLAGS;
83
84 #define CSSM_KR_INDIV (0x00000001)
85 #define CSSM_KR_ENT (0x00000002)
86 #define CSSM_KR_LE_MAN (0x00000004)
87 #define CSSM_KR_LE_USE (0x00000008)
88 #define CSSM_KR_LE (CSSM_KR_LE_MAN | CSSM_KR_LE_USE)
89 #define CSSM_KR_OPTIMIZE (0x00000010)
90 #define CSSM_KR_DROP_WORKFACTOR (0x00000020)
91
92 typedef struct cssm_kr_policy_list_item {
93 struct kr_policy_list_item *next;
94 CSSM_ALGORITHMS AlgorithmId;
95 CSSM_ENCRYPT_MODE Mode;
96 uint32 MaxKeyLength;
97 uint32 MaxRounds;
98 uint8 WorkFactor;
99 CSSM_KR_POLICY_FLAGS PolicyFlags;
100 CSSM_CONTEXT_TYPE AlgClass;
101 } CSSM_KR_POLICY_LIST_ITEM DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_POLICY_LIST_ITEM_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
102
103 typedef struct cssm_kr_policy_info {
104 CSSM_BOOL krbNotAllowed;
105 uint32 numberOfEntries;
106 CSSM_KR_POLICY_LIST_ITEM *policyEntry;
107 } CSSM_KR_POLICY_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KR_POLICY_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
108
109
110 /* Key Recovery Module Mangement Operations */
111
112 CSSM_RETURN CSSMAPI
113 CSSM_KR_SetEnterpriseRecoveryPolicy (const CSSM_DATA *RecoveryPolicyFileName,
114 const CSSM_ACCESS_CREDENTIALS *OldPassPhrase,
115 const CSSM_ACCESS_CREDENTIALS *NewPassPhrase)
116 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
117
118
119 /* Key Recovery Context Operations */
120
121 CSSM_RETURN CSSMAPI
122 CSSM_KR_CreateRecoveryRegistrationContext (CSSM_KRSP_HANDLE KRSPHandle,
123 CSSM_CC_HANDLE *NewContext)
124 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
125
126 CSSM_RETURN CSSMAPI
127 CSSM_KR_CreateRecoveryEnablementContext (CSSM_KRSP_HANDLE KRSPHandle,
128 const CSSM_KR_PROFILE *LocalProfile,
129 const CSSM_KR_PROFILE *RemoteProfile,
130 CSSM_CC_HANDLE *NewContext)
131 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
132
133 CSSM_RETURN CSSMAPI
134 CSSM_KR_CreateRecoveryRequestContext (CSSM_KRSP_HANDLE KRSPHandle,
135 const CSSM_KR_PROFILE *LocalProfile,
136 CSSM_CC_HANDLE *NewContext)
137 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
138
139 CSSM_RETURN CSSMAPI
140 CSSM_KR_GetPolicyInfo (CSSM_CC_HANDLE CCHandle,
141 CSSM_KR_POLICY_FLAGS *EncryptionProhibited,
142 uint32 *WorkFactor)
143 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
144
145
146 /* Key Recovery Registration Operations */
147
148 CSSM_RETURN CSSMAPI
149 CSSM_KR_RegistrationRequest (CSSM_CC_HANDLE RecoveryRegistrationContext,
150 const CSSM_DATA *KRInData,
151 const CSSM_ACCESS_CREDENTIALS *AccessCredentials,
152 CSSM_KR_POLICY_FLAGS KRFlags,
153 sint32 *EstimatedTime,
154 CSSM_HANDLE_PTR ReferenceHandle)
155 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
156
157 CSSM_RETURN CSSMAPI
158 CSSM_KR_RegistrationRetrieve (CSSM_KRSP_HANDLE KRSPHandle,
159 CSSM_HANDLE ReferenceHandle,
160 const CSSM_ACCESS_CREDENTIALS *AccessCredentials,
161 sint32 *EstimatedTime,
162 CSSM_KR_PROFILE_PTR KRProfile)
163 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
164
165
166 /* Key Recovery Enablement Operations */
167
168 CSSM_RETURN CSSMAPI
169 CSSM_KR_GenerateRecoveryFields (CSSM_CC_HANDLE KeyRecoveryContext,
170 CSSM_CC_HANDLE CCHandle,
171 const CSSM_DATA *KRSPOptions,
172 CSSM_KR_POLICY_FLAGS KRFlags,
173 CSSM_DATA_PTR KRFields,
174 CSSM_CC_HANDLE *NewCCHandle)
175 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
176
177 CSSM_RETURN CSSMAPI
178 CSSM_KR_ProcessRecoveryFields (CSSM_CC_HANDLE KeyRecoveryContext,
179 CSSM_CC_HANDLE CryptoContext,
180 const CSSM_DATA *KRSPOptions,
181 CSSM_KR_POLICY_FLAGS KRFlags,
182 const CSSM_DATA *KRFields,
183 CSSM_CC_HANDLE *NewCryptoContext)
184 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
185
186
187 /* Key Recovery Request Operations */
188
189 CSSM_RETURN CSSMAPI
190 CSSM_KR_RecoveryRequest (CSSM_CC_HANDLE RecoveryRequestContext,
191 const CSSM_DATA *KRInData,
192 const CSSM_ACCESS_CREDENTIALS *AccessCredentials,
193 sint32 *EstimatedTime,
194 CSSM_HANDLE_PTR ReferenceHandle)
195 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
196
197 CSSM_RETURN CSSMAPI
198 CSSM_KR_RecoveryRetrieve (CSSM_KRSP_HANDLE KRSPHandle,
199 CSSM_HANDLE ReferenceHandle,
200 const CSSM_ACCESS_CREDENTIALS *AccessCredentials,
201 sint32 *EstimatedTime,
202 CSSM_HANDLE_PTR CacheHandle,
203 uint32 *NumberOfRecoveredKeys)
204 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
205
206 CSSM_RETURN CSSMAPI
207 CSSM_KR_GetRecoveredObject (CSSM_KRSP_HANDLE KRSPHandle,
208 CSSM_HANDLE CacheHandle,
209 uint32 IndexInResults,
210 CSSM_CSP_HANDLE CSPHandle,
211 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry,
212 uint32 Flags,
213 CSSM_KEY_PTR RecoveredKey,
214 CSSM_DATA_PTR OtherInfo)
215 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
216
217 CSSM_RETURN CSSMAPI
218 CSSM_KR_RecoveryRequestAbort (CSSM_KRSP_HANDLE KRSPHandle,
219 CSSM_HANDLE CacheHandle)
220 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
221
222 CSSM_RETURN CSSMAPI
223 CSSM_KR_QueryPolicyInfo (CSSM_KRSP_HANDLE KRSPHandle,
224 CSSM_ALGORITHMS AlgorithmID,
225 CSSM_ENCRYPT_MODE Mode,
226 CSSM_CONTEXT_TYPE Class,
227 CSSM_KR_POLICY_INFO_PTR *PolicyInfoData)
228 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
229
230
231 /* Extensibility Functions */
232
233 CSSM_RETURN CSSMAPI
234 CSSM_KR_PassThrough (CSSM_KRSP_HANDLE KRSPHandle,
235 CSSM_CC_HANDLE KeyRecoveryContext,
236 CSSM_CC_HANDLE CryptoContext,
237 uint32 PassThroughId,
238 const void *InputParams,
239 void **OutputParams)
240 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
241
242 #pragma clang diagnostic pop
243
244 #ifdef __cplusplus
245 }
246 #endif
247
248 #endif /* _CSSMKRAPI_H_ */