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 * cssmcli.h -- Service Provider Interface for Certificate Library Modules
29 #include <Security/cssmtype.h>
35 typedef struct cssm_spi_cl_funcs
{
36 CSSM_RETURN (CSSMCLI
*CertCreateTemplate
)
37 (CSSM_CL_HANDLE CLHandle
,
38 uint32 NumberOfFields
,
39 const CSSM_FIELD
*CertFields
,
40 CSSM_DATA_PTR CertTemplate
);
41 CSSM_RETURN (CSSMCLI
*CertGetAllTemplateFields
)
42 (CSSM_CL_HANDLE CLHandle
,
43 const CSSM_DATA
*CertTemplate
,
44 uint32
*NumberOfFields
,
45 CSSM_FIELD_PTR
*CertFields
);
46 CSSM_RETURN (CSSMCLI
*CertSign
)
47 (CSSM_CL_HANDLE CLHandle
,
48 CSSM_CC_HANDLE CCHandle
,
49 const CSSM_DATA
*CertTemplate
,
50 const CSSM_FIELD
*SignScope
,
52 CSSM_DATA_PTR SignedCert
);
53 CSSM_RETURN (CSSMCLI
*CertVerify
)
54 (CSSM_CL_HANDLE CLHandle
,
55 CSSM_CC_HANDLE CCHandle
,
56 const CSSM_DATA
*CertToBeVerified
,
57 const CSSM_DATA
*SignerCert
,
58 const CSSM_FIELD
*VerifyScope
,
60 CSSM_RETURN (CSSMCLI
*CertVerifyWithKey
)
61 (CSSM_CL_HANDLE CLHandle
,
62 CSSM_CC_HANDLE CCHandle
,
63 const CSSM_DATA
*CertToBeVerified
);
64 CSSM_RETURN (CSSMCLI
*CertGetFirstFieldValue
)
65 (CSSM_CL_HANDLE CLHandle
,
66 const CSSM_DATA
*Cert
,
67 const CSSM_OID
*CertField
,
68 CSSM_HANDLE_PTR ResultsHandle
,
69 uint32
*NumberOfMatchedFields
,
70 CSSM_DATA_PTR
*Value
);
71 CSSM_RETURN (CSSMCLI
*CertGetNextFieldValue
)
72 (CSSM_CL_HANDLE CLHandle
,
73 CSSM_HANDLE ResultsHandle
,
74 CSSM_DATA_PTR
*Value
);
75 CSSM_RETURN (CSSMCLI
*CertAbortQuery
)
76 (CSSM_CL_HANDLE CLHandle
,
77 CSSM_HANDLE ResultsHandle
);
78 CSSM_RETURN (CSSMCLI
*CertGetKeyInfo
)
79 (CSSM_CL_HANDLE CLHandle
,
80 const CSSM_DATA
*Cert
,
82 CSSM_RETURN (CSSMCLI
*CertGetAllFields
)
83 (CSSM_CL_HANDLE CLHandle
,
84 const CSSM_DATA
*Cert
,
85 uint32
*NumberOfFields
,
86 CSSM_FIELD_PTR
*CertFields
);
87 CSSM_RETURN (CSSMCLI
*FreeFields
)
88 (CSSM_CL_HANDLE CLHandle
,
89 uint32 NumberOfFields
,
90 CSSM_FIELD_PTR
*FieldArray
);
91 CSSM_RETURN (CSSMCLI
*FreeFieldValue
)
92 (CSSM_CL_HANDLE CLHandle
,
93 const CSSM_OID
*CertOrCrlOid
,
95 CSSM_RETURN (CSSMCLI
*CertCache
)
96 (CSSM_CL_HANDLE CLHandle
,
97 const CSSM_DATA
*Cert
,
98 CSSM_HANDLE_PTR CertHandle
);
99 CSSM_RETURN (CSSMCLI
*CertGetFirstCachedFieldValue
)
100 (CSSM_CL_HANDLE CLHandle
,
101 CSSM_HANDLE CertHandle
,
102 const CSSM_OID
*CertField
,
103 CSSM_HANDLE_PTR ResultsHandle
,
104 uint32
*NumberOfMatchedFields
,
105 CSSM_DATA_PTR
*Value
);
106 CSSM_RETURN (CSSMCLI
*CertGetNextCachedFieldValue
)
107 (CSSM_CL_HANDLE CLHandle
,
108 CSSM_HANDLE ResultsHandle
,
109 CSSM_DATA_PTR
*Value
);
110 CSSM_RETURN (CSSMCLI
*CertAbortCache
)
111 (CSSM_CL_HANDLE CLHandle
,
112 CSSM_HANDLE CertHandle
);
113 CSSM_RETURN (CSSMCLI
*CertGroupToSignedBundle
)
114 (CSSM_CL_HANDLE CLHandle
,
115 CSSM_CC_HANDLE CCHandle
,
116 const CSSM_CERTGROUP
*CertGroupToBundle
,
117 const CSSM_CERT_BUNDLE_HEADER
*BundleInfo
,
118 CSSM_DATA_PTR SignedBundle
);
119 CSSM_RETURN (CSSMCLI
*CertGroupFromVerifiedBundle
)
120 (CSSM_CL_HANDLE CLHandle
,
121 CSSM_CC_HANDLE CCHandle
,
122 const CSSM_CERT_BUNDLE
*CertBundle
,
123 const CSSM_DATA
*SignerCert
,
124 CSSM_CERTGROUP_PTR
*CertGroup
);
125 CSSM_RETURN (CSSMCLI
*CertDescribeFormat
)
126 (CSSM_CL_HANDLE CLHandle
,
127 uint32
*NumberOfFields
,
128 CSSM_OID_PTR
*OidList
);
129 CSSM_RETURN (CSSMCLI
*CrlCreateTemplate
)
130 (CSSM_CL_HANDLE CLHandle
,
131 uint32 NumberOfFields
,
132 const CSSM_FIELD
*CrlTemplate
,
133 CSSM_DATA_PTR NewCrl
);
134 CSSM_RETURN (CSSMCLI
*CrlSetFields
)
135 (CSSM_CL_HANDLE CLHandle
,
136 uint32 NumberOfFields
,
137 const CSSM_FIELD
*CrlTemplate
,
138 const CSSM_DATA
*OldCrl
,
139 CSSM_DATA_PTR ModifiedCrl
);
140 CSSM_RETURN (CSSMCLI
*CrlAddCert
)
141 (CSSM_CL_HANDLE CLHandle
,
142 CSSM_CC_HANDLE CCHandle
,
143 const CSSM_DATA
*Cert
,
144 uint32 NumberOfFields
,
145 const CSSM_FIELD
*CrlEntryFields
,
146 const CSSM_DATA
*OldCrl
,
147 CSSM_DATA_PTR NewCrl
);
148 CSSM_RETURN (CSSMCLI
*CrlRemoveCert
)
149 (CSSM_CL_HANDLE CLHandle
,
150 const CSSM_DATA
*Cert
,
151 const CSSM_DATA
*OldCrl
,
152 CSSM_DATA_PTR NewCrl
);
153 CSSM_RETURN (CSSMCLI
*CrlSign
)
154 (CSSM_CL_HANDLE CLHandle
,
155 CSSM_CC_HANDLE CCHandle
,
156 const CSSM_DATA
*UnsignedCrl
,
157 const CSSM_FIELD
*SignScope
,
159 CSSM_DATA_PTR SignedCrl
);
160 CSSM_RETURN (CSSMCLI
*CrlVerify
)
161 (CSSM_CL_HANDLE CLHandle
,
162 CSSM_CC_HANDLE CCHandle
,
163 const CSSM_DATA
*CrlToBeVerified
,
164 const CSSM_DATA
*SignerCert
,
165 const CSSM_FIELD
*VerifyScope
,
167 CSSM_RETURN (CSSMCLI
*CrlVerifyWithKey
)
168 (CSSM_CL_HANDLE CLHandle
,
169 CSSM_CC_HANDLE CCHandle
,
170 const CSSM_DATA
*CrlToBeVerified
);
171 CSSM_RETURN (CSSMCLI
*IsCertInCrl
)
172 (CSSM_CL_HANDLE CLHandle
,
173 const CSSM_DATA
*Cert
,
174 const CSSM_DATA
*Crl
,
175 CSSM_BOOL
*CertFound
);
176 CSSM_RETURN (CSSMCLI
*CrlGetFirstFieldValue
)
177 (CSSM_CL_HANDLE CLHandle
,
178 const CSSM_DATA
*Crl
,
179 const CSSM_OID
*CrlField
,
180 CSSM_HANDLE_PTR ResultsHandle
,
181 uint32
*NumberOfMatchedFields
,
182 CSSM_DATA_PTR
*Value
);
183 CSSM_RETURN (CSSMCLI
*CrlGetNextFieldValue
)
184 (CSSM_CL_HANDLE CLHandle
,
185 CSSM_HANDLE ResultsHandle
,
186 CSSM_DATA_PTR
*Value
);
187 CSSM_RETURN (CSSMCLI
*CrlAbortQuery
)
188 (CSSM_CL_HANDLE CLHandle
,
189 CSSM_HANDLE ResultsHandle
);
190 CSSM_RETURN (CSSMCLI
*CrlGetAllFields
)
191 (CSSM_CL_HANDLE CLHandle
,
192 const CSSM_DATA
*Crl
,
193 uint32
*NumberOfCrlFields
,
194 CSSM_FIELD_PTR
*CrlFields
);
195 CSSM_RETURN (CSSMCLI
*CrlCache
)
196 (CSSM_CL_HANDLE CLHandle
,
197 const CSSM_DATA
*Crl
,
198 CSSM_HANDLE_PTR CrlHandle
);
199 CSSM_RETURN (CSSMCLI
*IsCertInCachedCrl
)
200 (CSSM_CL_HANDLE CLHandle
,
201 const CSSM_DATA
*Cert
,
202 CSSM_HANDLE CrlHandle
,
203 CSSM_BOOL
*CertFound
,
204 CSSM_DATA_PTR CrlRecordIndex
);
205 CSSM_RETURN (CSSMCLI
*CrlGetFirstCachedFieldValue
)
206 (CSSM_CL_HANDLE CLHandle
,
207 CSSM_HANDLE CrlHandle
,
208 const CSSM_DATA
*CrlRecordIndex
,
209 const CSSM_OID
*CrlField
,
210 CSSM_HANDLE_PTR ResultsHandle
,
211 uint32
*NumberOfMatchedFields
,
212 CSSM_DATA_PTR
*Value
);
213 CSSM_RETURN (CSSMCLI
*CrlGetNextCachedFieldValue
)
214 (CSSM_CL_HANDLE CLHandle
,
215 CSSM_HANDLE ResultsHandle
,
216 CSSM_DATA_PTR
*Value
);
217 CSSM_RETURN (CSSMCLI
*CrlGetAllCachedRecordFields
)
218 (CSSM_CL_HANDLE CLHandle
,
219 CSSM_HANDLE CrlHandle
,
220 const CSSM_DATA
*CrlRecordIndex
,
221 uint32
*NumberOfFields
,
222 CSSM_FIELD_PTR
*CrlFields
);
223 CSSM_RETURN (CSSMCLI
*CrlAbortCache
)
224 (CSSM_CL_HANDLE CLHandle
,
225 CSSM_HANDLE CrlHandle
);
226 CSSM_RETURN (CSSMCLI
*CrlDescribeFormat
)
227 (CSSM_CL_HANDLE CLHandle
,
228 uint32
*NumberOfFields
,
229 CSSM_OID_PTR
*OidList
);
230 CSSM_RETURN (CSSMCLI
*PassThrough
)
231 (CSSM_CL_HANDLE CLHandle
,
232 CSSM_CC_HANDLE CCHandle
,
233 uint32 PassThroughId
,
234 const void *InputParams
,
235 void **OutputParams
);
236 } CSSM_SPI_CL_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
, *CSSM_SPI_CL_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
;
242 #endif /* _CSSMCLI_H_ */