2 * Copyright (c) 1999-2001,2004,2011,2014 Apple Inc. All Rights Reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
23 * cssmkrapi.h -- Application Programmers Interface for Key Recovery Modules
27 #define _CSSMKRAPI_H_ 1
29 #include <Security/cssmtype.h>
35 #pragma clang diagnostic push
36 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
38 typedef uint32 CSSM_KRSP_HANDLE
; /* Key Recovery Service Provider Handle */
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
;
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
;
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
;
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
;
70 typedef struct cssm_krsubservice
{
72 char *Description
; /* Description of this sub service */
73 CSSM_KR_WRAPPEDPRODUCT_INFO WrappedProduct
;
74 } CSSM_KRSUBSERVICE
, *CSSM_KRSUBSERVICE_PTR
;
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)
82 typedef uint32 CSSM_KR_POLICY_FLAGS
;
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)
92 typedef struct cssm_kr_policy_list_item
{
93 struct kr_policy_list_item
*next
;
94 CSSM_ALGORITHMS AlgorithmId
;
95 CSSM_ENCRYPT_MODE Mode
;
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
;
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
;
110 /* Key Recovery Module Mangement Operations */
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
;
119 /* Key Recovery Context Operations */
122 CSSM_KR_CreateRecoveryRegistrationContext (CSSM_KRSP_HANDLE KRSPHandle
,
123 CSSM_CC_HANDLE
*NewContext
)
124 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
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
;
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
;
140 CSSM_KR_GetPolicyInfo (CSSM_CC_HANDLE CCHandle
,
141 CSSM_KR_POLICY_FLAGS
*EncryptionProhibited
,
143 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
146 /* Key Recovery Registration Operations */
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
;
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
;
166 /* Key Recovery Enablement Operations */
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
;
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
;
187 /* Key Recovery Request Operations */
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
;
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
;
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
,
213 CSSM_KEY_PTR RecoveredKey
,
214 CSSM_DATA_PTR OtherInfo
)
215 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
218 CSSM_KR_RecoveryRequestAbort (CSSM_KRSP_HANDLE KRSPHandle
,
219 CSSM_HANDLE CacheHandle
)
220 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
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
;
231 /* Extensibility Functions */
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
,
240 DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
242 #pragma clang diagnostic pop
248 #endif /* _CSSMKRAPI_H_ */