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 * cssmkrspi.h -- Service Provider Interface for Key Recovery Modules
27 #define _CSSMKRSPI_H_ 1
29 #include <Security/cssmtype.h>
35 /* Data types for Key Recovery SPI */
37 typedef struct cssm_spi_kr_funcs
{
38 CSSM_RETURN (CSSMKRI
*RegistrationRequest
)
39 (CSSM_KRSP_HANDLE KRSPHandle
,
40 CSSM_CC_HANDLE KRRegistrationContextHandle
,
41 const CSSM_CONTEXT
*KRRegistrationContext
,
42 const CSSM_DATA
*KRInData
,
43 const CSSM_ACCESS_CREDENTIALS
*AccessCredentials
,
44 CSSM_KR_POLICY_FLAGS KRFlags
,
45 sint32
*EstimatedTime
,
46 CSSM_HANDLE_PTR ReferenceHandle
);
47 CSSM_RETURN (CSSMKRI
*RegistrationRetrieve
)
48 (CSSM_KRSP_HANDLE KRSPHandle
,
49 CSSM_HANDLE ReferenceHandle
,
50 sint32
*EstimatedTime
,
51 CSSM_KR_PROFILE_PTR KRProfile
);
52 CSSM_RETURN (CSSMKRI
*GenerateRecoveryFields
)
53 (CSSM_KRSP_HANDLE KRSPHandle
,
54 CSSM_CC_HANDLE KREnablementContextHandle
,
55 const CSSM_CONTEXT
*KREnablementContext
,
56 CSSM_CC_HANDLE CryptoContextHandle
,
57 const CSSM_CONTEXT
*CryptoContext
,
58 const CSSM_DATA
*KRSPOptions
,
59 CSSM_KR_POLICY_FLAGS KRFlags
,
60 CSSM_DATA_PTR KRFields
);
61 CSSM_RETURN (CSSMKRI
*ProcessRecoveryFields
)
62 (CSSM_KRSP_HANDLE KRSPHandle
,
63 CSSM_CC_HANDLE KREnablementContextHandle
,
64 const CSSM_CONTEXT
*KREnablementContext
,
65 CSSM_CC_HANDLE CryptoContextHandle
,
66 const CSSM_CONTEXT
*CryptoContext
,
67 const CSSM_DATA
*KRSPOptions
,
68 CSSM_KR_POLICY_FLAGS KRFlags
,
69 const CSSM_DATA
*KRFields
);
70 CSSM_RETURN (CSSMKRI
*RecoveryRequest
)
71 (CSSM_KRSP_HANDLE KRSPHandle
,
72 CSSM_CC_HANDLE KRRequestContextHandle
,
73 const CSSM_CONTEXT
*KRRequestContext
,
74 const CSSM_DATA
*KRInData
,
75 const CSSM_ACCESS_CREDENTIALS
*AccessCredentials
,
76 sint32
*EstimatedTime
,
77 CSSM_HANDLE_PTR ReferenceHandle
);
78 CSSM_RETURN (CSSMKRI
*RecoveryRetrieve
)
79 (CSSM_KRSP_HANDLE KRSPHandle
,
80 CSSM_HANDLE ReferenceHandle
,
81 sint32
*EstimatedTime
,
82 CSSM_HANDLE_PTR CacheHandle
,
83 uint32
*NumberOfRecoveredKeys
);
84 CSSM_RETURN (CSSMKRI
*GetRecoveredObject
)
85 (CSSM_KRSP_HANDLE KRSPHandle
,
86 CSSM_HANDLE CacheHandle
,
87 uint32 IndexInResults
,
88 CSSM_CSP_HANDLE CSPHandle
,
89 const CSSM_RESOURCE_CONTROL_CONTEXT
*CredAndAclEntry
,
91 CSSM_KEY_PTR RecoveredKey
,
92 CSSM_DATA_PTR OtherInfo
);
93 CSSM_RETURN (CSSMKRI
*RecoveryRequestAbort
)
94 (CSSM_KRSP_HANDLE KRSPHandle
,
95 CSSM_HANDLE ResultsHandle
);
96 CSSM_RETURN (CSSMKRI
*PassThrough
)
97 (CSSM_KRSP_HANDLE KRSPHandle
,
98 CSSM_CC_HANDLE KeyRecoveryContextHandle
,
99 const CSSM_CONTEXT
*KeyRecoveryContext
,
100 CSSM_CC_HANDLE CryptoContextHandle
,
101 const CSSM_CONTEXT
*CryptoContext
,
102 uint32 PassThroughId
,
103 const void *InputParams
,
104 void **OutputParams
);
105 } CSSM_SPI_KR_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
, *CSSM_SPI_KR_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
111 #endif /* _CSSMKRSPI_H_ */