]> git.saurik.com Git - apple/security.git/blob - Security/libsecurity_cssm/lib/cssmtpi.h
Security-57031.40.6.tar.gz
[apple/security.git] / Security / libsecurity_cssm / lib / cssmtpi.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 * cssmtpi.h -- Service Provider Interface for Trust Policy Modules
24 */
25
26 #ifndef _CSSMTPI_H_
27 #define _CSSMTPI_H_ 1
28
29 #include <Security/cssmtype.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef struct cssm_spi_tp_funcs {
36 CSSM_RETURN (CSSMTPI *SubmitCredRequest)
37 (CSSM_TP_HANDLE TPHandle,
38 const CSSM_TP_AUTHORITY_ID *PreferredAuthority,
39 CSSM_TP_AUTHORITY_REQUEST_TYPE RequestType,
40 const CSSM_TP_REQUEST_SET *RequestInput,
41 const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthContext,
42 sint32 *EstimatedTime,
43 CSSM_DATA_PTR ReferenceIdentifier);
44 CSSM_RETURN (CSSMTPI *RetrieveCredResult)
45 (CSSM_TP_HANDLE TPHandle,
46 const CSSM_DATA *ReferenceIdentifier,
47 const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials,
48 sint32 *EstimatedTime,
49 CSSM_BOOL *ConfirmationRequired,
50 CSSM_TP_RESULT_SET_PTR *RetrieveOutput);
51 CSSM_RETURN (CSSMTPI *ConfirmCredResult)
52 (CSSM_TP_HANDLE TPHandle,
53 const CSSM_DATA *ReferenceIdentifier,
54 const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthCredentials,
55 const CSSM_TP_CONFIRM_RESPONSE *Responses,
56 const CSSM_TP_AUTHORITY_ID *PreferredAuthority);
57 CSSM_RETURN (CSSMTPI *ReceiveConfirmation)
58 (CSSM_TP_HANDLE TPHandle,
59 const CSSM_DATA *ReferenceIdentifier,
60 CSSM_TP_CONFIRM_RESPONSE_PTR *Responses,
61 sint32 *ElapsedTime);
62 CSSM_RETURN (CSSMTPI *CertReclaimKey)
63 (CSSM_TP_HANDLE TPHandle,
64 const CSSM_CERTGROUP *CertGroup,
65 uint32 CertIndex,
66 CSSM_LONG_HANDLE KeyCacheHandle,
67 CSSM_CSP_HANDLE CSPHandle,
68 const CSSM_RESOURCE_CONTROL_CONTEXT *CredAndAclEntry);
69 CSSM_RETURN (CSSMTPI *CertReclaimAbort)
70 (CSSM_TP_HANDLE TPHandle,
71 CSSM_LONG_HANDLE KeyCacheHandle);
72 CSSM_RETURN (CSSMTPI *FormRequest)
73 (CSSM_TP_HANDLE TPHandle,
74 const CSSM_TP_AUTHORITY_ID *PreferredAuthority,
75 CSSM_TP_FORM_TYPE FormType,
76 CSSM_DATA_PTR BlankForm);
77 CSSM_RETURN (CSSMTPI *FormSubmit)
78 (CSSM_TP_HANDLE TPHandle,
79 CSSM_TP_FORM_TYPE FormType,
80 const CSSM_DATA *Form,
81 const CSSM_TP_AUTHORITY_ID *ClearanceAuthority,
82 const CSSM_TP_AUTHORITY_ID *RepresentedAuthority,
83 CSSM_ACCESS_CREDENTIALS_PTR Credentials);
84 CSSM_RETURN (CSSMTPI *CertGroupVerify)
85 (CSSM_TP_HANDLE TPHandle,
86 CSSM_CL_HANDLE CLHandle,
87 CSSM_CSP_HANDLE CSPHandle,
88 const CSSM_CERTGROUP *CertGroupToBeVerified,
89 const CSSM_TP_VERIFY_CONTEXT *VerifyContext,
90 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR VerifyContextResult);
91 CSSM_RETURN (CSSMTPI *CertCreateTemplate)
92 (CSSM_TP_HANDLE TPHandle,
93 CSSM_CL_HANDLE CLHandle,
94 uint32 NumberOfFields,
95 const CSSM_FIELD *CertFields,
96 CSSM_DATA_PTR CertTemplate);
97 CSSM_RETURN (CSSMTPI *CertGetAllTemplateFields)
98 (CSSM_TP_HANDLE TPHandle,
99 CSSM_CL_HANDLE CLHandle,
100 const CSSM_DATA *CertTemplate,
101 uint32 *NumberOfFields,
102 CSSM_FIELD_PTR *CertFields);
103 CSSM_RETURN (CSSMTPI *CertSign)
104 (CSSM_TP_HANDLE TPHandle,
105 CSSM_CL_HANDLE CLHandle,
106 CSSM_CC_HANDLE CCHandle,
107 const CSSM_DATA *CertTemplateToBeSigned,
108 const CSSM_CERTGROUP *SignerCertGroup,
109 const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext,
110 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult,
111 CSSM_DATA_PTR SignedCert);
112 CSSM_RETURN (CSSMTPI *CrlVerify)
113 (CSSM_TP_HANDLE TPHandle,
114 CSSM_CL_HANDLE CLHandle,
115 CSSM_CSP_HANDLE CSPHandle,
116 const CSSM_ENCODED_CRL *CrlToBeVerified,
117 const CSSM_CERTGROUP *SignerCertGroup,
118 const CSSM_TP_VERIFY_CONTEXT *VerifyContext,
119 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult);
120 CSSM_RETURN (CSSMTPI *CrlCreateTemplate)
121 (CSSM_TP_HANDLE TPHandle,
122 CSSM_CL_HANDLE CLHandle,
123 uint32 NumberOfFields,
124 const CSSM_FIELD *CrlFields,
125 CSSM_DATA_PTR NewCrlTemplate);
126 CSSM_RETURN (CSSMTPI *CertRevoke)
127 (CSSM_TP_HANDLE TPHandle,
128 CSSM_CL_HANDLE CLHandle,
129 CSSM_CSP_HANDLE CSPHandle,
130 const CSSM_DATA *OldCrlTemplate,
131 const CSSM_CERTGROUP *CertGroupToBeRevoked,
132 const CSSM_CERTGROUP *RevokerCertGroup,
133 const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext,
134 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult,
135 CSSM_TP_CERTCHANGE_REASON Reason,
136 CSSM_DATA_PTR NewCrlTemplate);
137 CSSM_RETURN (CSSMTPI *CertRemoveFromCrlTemplate)
138 (CSSM_TP_HANDLE TPHandle,
139 CSSM_CL_HANDLE CLHandle,
140 CSSM_CSP_HANDLE CSPHandle,
141 const CSSM_DATA *OldCrlTemplate,
142 const CSSM_CERTGROUP *CertGroupToBeRemoved,
143 const CSSM_CERTGROUP *RevokerCertGroup,
144 const CSSM_TP_VERIFY_CONTEXT *RevokerVerifyContext,
145 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR RevokerVerifyResult,
146 CSSM_DATA_PTR NewCrlTemplate);
147 CSSM_RETURN (CSSMTPI *CrlSign)
148 (CSSM_TP_HANDLE TPHandle,
149 CSSM_CL_HANDLE CLHandle,
150 CSSM_CC_HANDLE CCHandle,
151 const CSSM_ENCODED_CRL *CrlToBeSigned,
152 const CSSM_CERTGROUP *SignerCertGroup,
153 const CSSM_TP_VERIFY_CONTEXT *SignerVerifyContext,
154 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR SignerVerifyResult,
155 CSSM_DATA_PTR SignedCrl);
156 CSSM_RETURN (CSSMTPI *ApplyCrlToDb)
157 (CSSM_TP_HANDLE TPHandle,
158 CSSM_CL_HANDLE CLHandle,
159 CSSM_CSP_HANDLE CSPHandle,
160 const CSSM_ENCODED_CRL *CrlToBeApplied,
161 const CSSM_CERTGROUP *SignerCertGroup,
162 const CSSM_TP_VERIFY_CONTEXT *ApplyCrlVerifyContext,
163 CSSM_TP_VERIFY_CONTEXT_RESULT_PTR ApplyCrlVerifyResult);
164 CSSM_RETURN (CSSMTPI *CertGroupConstruct)
165 (CSSM_TP_HANDLE TPHandle,
166 CSSM_CL_HANDLE CLHandle,
167 CSSM_CSP_HANDLE CSPHandle,
168 const CSSM_DL_DB_LIST *DBList,
169 const void *ConstructParams,
170 const CSSM_CERTGROUP *CertGroupFrag,
171 CSSM_CERTGROUP_PTR *CertGroup);
172 CSSM_RETURN (CSSMTPI *CertGroupPrune)
173 (CSSM_TP_HANDLE TPHandle,
174 CSSM_CL_HANDLE CLHandle,
175 const CSSM_DL_DB_LIST *DBList,
176 const CSSM_CERTGROUP *OrderedCertGroup,
177 CSSM_CERTGROUP_PTR *PrunedCertGroup);
178 CSSM_RETURN (CSSMTPI *CertGroupToTupleGroup)
179 (CSSM_TP_HANDLE TPHandle,
180 CSSM_CL_HANDLE CLHandle,
181 const CSSM_CERTGROUP *CertGroup,
182 CSSM_TUPLEGROUP_PTR *TupleGroup);
183 CSSM_RETURN (CSSMTPI *TupleGroupToCertGroup)
184 (CSSM_TP_HANDLE TPHandle,
185 CSSM_CL_HANDLE CLHandle,
186 const CSSM_TUPLEGROUP *TupleGroup,
187 CSSM_CERTGROUP_PTR *CertTemplates);
188 CSSM_RETURN (CSSMTPI *PassThrough)
189 (CSSM_TP_HANDLE TPHandle,
190 CSSM_CL_HANDLE CLHandle,
191 CSSM_CC_HANDLE CCHandle,
192 const CSSM_DL_DB_LIST *DBList,
193 uint32 PassThroughId,
194 const void *InputParams,
195 void **OutputParams);
196 } CSSM_SPI_TP_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SPI_TP_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
197
198 #ifdef __cplusplus
199 }
200 #endif
201
202 #endif /* _CSSMTPI_H_ */