]> git.saurik.com Git - apple/security.git/blob - libsecurity_cssm/lib/cssmtype.h
Security-55471.14.4.tar.gz
[apple/security.git] / libsecurity_cssm / lib / cssmtype.h
1 /*
2 * Copyright (c) 1999-2002,2004 Apple Computer, 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 * cssmtype.h -- Common Security Services Manager Common Data Types
24 */
25
26 #ifndef _CSSMTYPE_H_
27 #define _CSSMTYPE_H_ 1
28
29 #include <Security/cssmconfig.h>
30
31 /* ==========================================================================
32 W A R N I N G : CDSA has been deprecated starting with 10.7. While the
33 APIs will continue to work, developers should update their code to use
34 the APIs that are suggested and NOT use the CDSA APIs
35 ========================================================================== */
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 /* Handle types. */
42
43 typedef CSSM_INTPTR CSSM_HANDLE, *CSSM_HANDLE_PTR;
44
45 typedef uint64 CSSM_LONG_HANDLE, *CSSM_LONG_HANDLE_PTR;
46
47 typedef CSSM_HANDLE CSSM_MODULE_HANDLE, *CSSM_MODULE_HANDLE_PTR;
48
49 typedef CSSM_LONG_HANDLE CSSM_CC_HANDLE; /* Cryptographic Context Handle */
50
51 typedef CSSM_MODULE_HANDLE CSSM_CSP_HANDLE; /* Cryptographic Service Provider Handle */
52
53 typedef CSSM_MODULE_HANDLE CSSM_TP_HANDLE; /* Trust Policy Handle */
54
55 typedef CSSM_MODULE_HANDLE CSSM_AC_HANDLE; /* Authorization Computation Handle */
56
57 typedef CSSM_MODULE_HANDLE CSSM_CL_HANDLE; /* Certificate Library Handle */
58
59 typedef CSSM_MODULE_HANDLE CSSM_DL_HANDLE; /* Data Storage Library Handle */
60
61 typedef CSSM_MODULE_HANDLE CSSM_DB_HANDLE; /* Data Storage Database Handle */
62
63
64 /* invalid or NULL value for any CSSM_HANDLE type */
65 enum {
66 CSSM_INVALID_HANDLE = 0
67 };
68
69
70 /* Data Types for Core Services */
71
72 typedef sint32 CSSM_BOOL;
73 enum {
74 CSSM_FALSE = 0,
75 CSSM_TRUE = !CSSM_FALSE
76 };
77
78 /* The standard declares this as uint32 but we changed it to sint32 to match OSStatus. */
79 typedef sint32 CSSM_RETURN;
80 enum {
81 CSSM_OK = 0
82 };
83
84 enum {
85 CSSM_MODULE_STRING_SIZE = 64
86 };
87 typedef char CSSM_STRING [CSSM_MODULE_STRING_SIZE + 4];
88
89 typedef struct cssm_data {
90 CSSM_SIZE Length; /* in bytes */
91 uint8 *Data;
92 } CSSM_DATA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DATA_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
93
94 typedef struct cssm_guid {
95 uint32 Data1;
96 uint16 Data2;
97 uint16 Data3;
98 uint8 Data4[8];
99 } CSSM_GUID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_GUID_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
100
101 typedef uint32 CSSM_BITMASK;
102 typedef CSSM_BITMASK CSSM_KEY_HIERARCHY;
103 enum {
104 CSSM_KEY_HIERARCHY_NONE = 0,
105 CSSM_KEY_HIERARCHY_INTEG = 1,
106 CSSM_KEY_HIERARCHY_EXPORT = 2
107 };
108
109 typedef CSSM_BITMASK CSSM_PVC_MODE;
110 enum {
111 CSSM_PVC_NONE = 0,
112 CSSM_PVC_APP = 1,
113 CSSM_PVC_SP = 2
114 };
115
116 typedef uint32 CSSM_PRIVILEGE_SCOPE;
117 enum {
118 CSSM_PRIVILEGE_SCOPE_NONE = 0,
119 CSSM_PRIVILEGE_SCOPE_PROCESS = 1,
120 CSSM_PRIVILEGE_SCOPE_THREAD = 2
121 };
122
123 typedef struct cssm_version {
124 uint32 Major;
125 uint32 Minor;
126 } CSSM_VERSION DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_VERSION_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
127
128 typedef uint32 CSSM_SERVICE_MASK;
129 enum {
130 CSSM_SERVICE_CSSM = 0x1,
131 CSSM_SERVICE_CSP = 0x2,
132 CSSM_SERVICE_DL = 0x4,
133 CSSM_SERVICE_CL = 0x8,
134 CSSM_SERVICE_TP = 0x10,
135 CSSM_SERVICE_AC = 0x20,
136 CSSM_SERVICE_KR = 0x40
137 };
138
139 typedef CSSM_SERVICE_MASK CSSM_SERVICE_TYPE;
140
141 typedef struct cssm_subservice_uid {
142 CSSM_GUID Guid;
143 CSSM_VERSION Version;
144 uint32 SubserviceId;
145 CSSM_SERVICE_TYPE SubserviceType;
146 } CSSM_SUBSERVICE_UID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SUBSERVICE_UID_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
147
148 typedef uint32 CSSM_MODULE_EVENT, *CSSM_MODULE_EVENT_PTR;
149 enum {
150 CSSM_NOTIFY_INSERT = 1,
151 CSSM_NOTIFY_REMOVE = 2,
152 CSSM_NOTIFY_FAULT = 3
153 };
154
155 typedef CSSM_RETURN (CSSMAPI *CSSM_API_ModuleEventHandler)
156 (const CSSM_GUID *ModuleGuid,
157 void* AppNotifyCallbackCtx,
158 uint32 SubserviceId,
159 CSSM_SERVICE_TYPE ServiceType,
160 CSSM_MODULE_EVENT EventType);
161
162 typedef uint32 CSSM_ATTACH_FLAGS;
163 enum {
164 CSSM_ATTACH_READ_ONLY = 0x00000001
165 };
166
167 /* Non-export privilege range: (0x00000000 - 0x7FFFFFFF) */
168 /* Vendor specific range: (0x80000000 - 0xFFFFFFFF) */
169 typedef uint64 CSSM_PRIVILEGE;
170 typedef CSSM_PRIVILEGE CSSM_USEE_TAG;
171 enum {
172 CSSM_USEE_LAST = 0xFF,
173 CSSM_USEE_NONE = 0,
174 CSSM_USEE_DOMESTIC = 1,
175 CSSM_USEE_FINANCIAL = 2,
176 CSSM_USEE_KRLE = 3,
177 CSSM_USEE_KRENT = 4,
178 CSSM_USEE_SSL = 5,
179 CSSM_USEE_AUTHENTICATION = 6,
180 CSSM_USEE_KEYEXCH = 7,
181 CSSM_USEE_MEDICAL = 8,
182 CSSM_USEE_INSURANCE = 9,
183 CSSM_USEE_WEAK = 10
184 };
185
186 typedef uint32 CSSM_NET_ADDRESS_TYPE;
187 enum {
188 CSSM_ADDR_NONE = 0,
189 CSSM_ADDR_CUSTOM = 1,
190 CSSM_ADDR_URL = 2, /* char* */
191 CSSM_ADDR_SOCKADDR = 3,
192 CSSM_ADDR_NAME = 4 /* char* - qualified by access method */
193 };
194
195 typedef struct cssm_net_address {
196 CSSM_NET_ADDRESS_TYPE AddressType;
197 CSSM_DATA Address;
198 } CSSM_NET_ADDRESS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_NET_ADDRESS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
199
200 typedef uint32 CSSM_NET_PROTOCOL;
201 enum {
202 CSSM_NET_PROTO_NONE = 0, /* local */
203 CSSM_NET_PROTO_CUSTOM = 1, /* proprietary implementation */
204 CSSM_NET_PROTO_UNSPECIFIED = 2, /* implementation default */
205 CSSM_NET_PROTO_LDAP = 3, /* light weight directory access protocol */
206 CSSM_NET_PROTO_LDAPS = 4, /* ldap/ssl where SSL initiates the connection */
207 CSSM_NET_PROTO_LDAPNS = 5, /* ldap where ldap negotiates an SSL session */
208 CSSM_NET_PROTO_X500DAP = 6, /* x.500 Directory access protocol */
209 CSSM_NET_PROTO_FTP = 7, /* ftp for cert/crl fetch */
210 CSSM_NET_PROTO_FTPS = 8, /* ftp/ssl/tls where SSL/TLS initiates the connection */
211 CSSM_NET_PROTO_OCSP = 9, /* online certificate status protocol */
212 CSSM_NET_PROTO_CMP = 10, /* the cert request protocol in PKIX3 */
213 CSSM_NET_PROTO_CMPS = 11 /* The ssl/tls derivative of CMP */
214 };
215
216 typedef CSSM_RETURN (CSSMAPI *CSSM_CALLBACK)
217 (CSSM_DATA_PTR OutData, void *CallerCtx);
218
219 typedef struct cssm_crypto_data {
220 CSSM_DATA Param;
221 CSSM_CALLBACK Callback;
222 void *CallerCtx;
223 } CSSM_CRYPTO_DATA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CRYPTO_DATA_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
224
225 typedef sint32 CSSM_WORDID_TYPE;
226 enum {
227 CSSM_WORDID__UNK_ = -1, /* not in dictionary */
228 CSSM_WORDID__NLU_ = 0, /* not yet looked up */
229 CSSM_WORDID__STAR_ = 1,
230 CSSM_WORDID_A = 2,
231 CSSM_WORDID_ACL = 3,
232 CSSM_WORDID_ALPHA = 4,
233 CSSM_WORDID_B = 5,
234 CSSM_WORDID_BER = 6,
235 CSSM_WORDID_BINARY = 7,
236 CSSM_WORDID_BIOMETRIC = 8,
237 CSSM_WORDID_C = 9,
238 CSSM_WORDID_CANCELED = 10,
239 CSSM_WORDID_CERT = 11,
240 CSSM_WORDID_COMMENT = 12,
241 CSSM_WORDID_CRL = 13,
242 CSSM_WORDID_CUSTOM = 14,
243 CSSM_WORDID_D = 15,
244 CSSM_WORDID_DATE = 16,
245 CSSM_WORDID_DB_DELETE = 17,
246 CSSM_WORDID_DB_EXEC_STORED_QUERY = 18,
247 CSSM_WORDID_DB_INSERT = 19,
248 CSSM_WORDID_DB_MODIFY = 20,
249 CSSM_WORDID_DB_READ = 21,
250 CSSM_WORDID_DBS_CREATE = 22,
251 CSSM_WORDID_DBS_DELETE = 23,
252 CSSM_WORDID_DECRYPT = 24,
253 CSSM_WORDID_DELETE = 25,
254 CSSM_WORDID_DELTA_CRL = 26,
255 CSSM_WORDID_DER = 27,
256 CSSM_WORDID_DERIVE = 28,
257 CSSM_WORDID_DISPLAY = 29,
258 CSSM_WORDID_DO = 30,
259 CSSM_WORDID_DSA = 31,
260 CSSM_WORDID_DSA_SHA1 = 32,
261 CSSM_WORDID_E = 33,
262 CSSM_WORDID_ELGAMAL = 34,
263 CSSM_WORDID_ENCRYPT = 35,
264 CSSM_WORDID_ENTRY = 36,
265 CSSM_WORDID_EXPORT_CLEAR = 37,
266 CSSM_WORDID_EXPORT_WRAPPED = 38,
267 CSSM_WORDID_G = 39,
268 CSSM_WORDID_GE = 40,
269 CSSM_WORDID_GENKEY = 41,
270 CSSM_WORDID_HASH = 42,
271 CSSM_WORDID_HASHED_PASSWORD = 43,
272 CSSM_WORDID_HASHED_SUBJECT = 44,
273 CSSM_WORDID_HAVAL = 45,
274 CSSM_WORDID_IBCHASH = 46,
275 CSSM_WORDID_IMPORT_CLEAR = 47,
276 CSSM_WORDID_IMPORT_WRAPPED = 48,
277 CSSM_WORDID_INTEL = 49,
278 CSSM_WORDID_ISSUER = 50,
279 CSSM_WORDID_ISSUER_INFO = 51,
280 CSSM_WORDID_K_OF_N = 52,
281 CSSM_WORDID_KEA = 53,
282 CSSM_WORDID_KEYHOLDER = 54,
283 CSSM_WORDID_L = 55,
284 CSSM_WORDID_LE = 56,
285 CSSM_WORDID_LOGIN = 57,
286 CSSM_WORDID_LOGIN_NAME = 58,
287 CSSM_WORDID_MAC = 59,
288 CSSM_WORDID_MD2 = 60,
289 CSSM_WORDID_MD2WITHRSA = 61,
290 CSSM_WORDID_MD4 = 62,
291 CSSM_WORDID_MD5 = 63,
292 CSSM_WORDID_MD5WITHRSA = 64,
293 CSSM_WORDID_N = 65,
294 CSSM_WORDID_NAME = 66,
295 CSSM_WORDID_NDR = 67,
296 CSSM_WORDID_NHASH = 68,
297 CSSM_WORDID_NOT_AFTER = 69,
298 CSSM_WORDID_NOT_BEFORE = 70,
299 CSSM_WORDID_NULL = 71,
300 CSSM_WORDID_NUMERIC = 72,
301 CSSM_WORDID_OBJECT_HASH = 73,
302 CSSM_WORDID_ONE_TIME = 74,
303 CSSM_WORDID_ONLINE = 75,
304 CSSM_WORDID_OWNER = 76,
305 CSSM_WORDID_P = 77,
306 CSSM_WORDID_PAM_NAME = 78,
307 CSSM_WORDID_PASSWORD = 79,
308 CSSM_WORDID_PGP = 80,
309 CSSM_WORDID_PREFIX = 81,
310 CSSM_WORDID_PRIVATE_KEY = 82,
311 CSSM_WORDID_PROMPTED_BIOMETRIC = 83,
312 CSSM_WORDID_PROMPTED_PASSWORD = 84,
313 CSSM_WORDID_PROPAGATE = 85,
314 CSSM_WORDID_PROTECTED_BIOMETRIC = 86,
315 CSSM_WORDID_PROTECTED_PASSWORD = 87,
316 CSSM_WORDID_PROTECTED_PIN = 88,
317 CSSM_WORDID_PUBLIC_KEY = 89,
318 CSSM_WORDID_PUBLIC_KEY_FROM_CERT = 90,
319 CSSM_WORDID_Q = 91,
320 CSSM_WORDID_RANGE = 92,
321 CSSM_WORDID_REVAL = 93,
322 CSSM_WORDID_RIPEMAC = 94,
323 CSSM_WORDID_RIPEMD = 95,
324 CSSM_WORDID_RIPEMD160 = 96,
325 CSSM_WORDID_RSA = 97,
326 CSSM_WORDID_RSA_ISO9796 = 98,
327 CSSM_WORDID_RSA_PKCS = 99,
328 CSSM_WORDID_RSA_PKCS_MD5 = 100,
329 CSSM_WORDID_RSA_PKCS_SHA1 = 101,
330 CSSM_WORDID_RSA_PKCS1 = 102,
331 CSSM_WORDID_RSA_PKCS1_MD5 = 103,
332 CSSM_WORDID_RSA_PKCS1_SHA1 = 104,
333 CSSM_WORDID_RSA_PKCS1_SIG = 105,
334 CSSM_WORDID_RSA_RAW = 106,
335 CSSM_WORDID_SDSIV1 = 107,
336 CSSM_WORDID_SEQUENCE = 108,
337 CSSM_WORDID_SET = 109,
338 CSSM_WORDID_SEXPR = 110,
339 CSSM_WORDID_SHA1 = 111,
340 CSSM_WORDID_SHA1WITHDSA = 112,
341 CSSM_WORDID_SHA1WITHECDSA = 113,
342 CSSM_WORDID_SHA1WITHRSA = 114,
343 CSSM_WORDID_SIGN = 115,
344 CSSM_WORDID_SIGNATURE = 116,
345 CSSM_WORDID_SIGNED_NONCE = 117,
346 CSSM_WORDID_SIGNED_SECRET = 118,
347 CSSM_WORDID_SPKI = 119,
348 CSSM_WORDID_SUBJECT = 120,
349 CSSM_WORDID_SUBJECT_INFO = 121,
350 CSSM_WORDID_TAG = 122,
351 CSSM_WORDID_THRESHOLD = 123,
352 CSSM_WORDID_TIME = 124,
353 CSSM_WORDID_URI = 125,
354 CSSM_WORDID_VERSION = 126,
355 CSSM_WORDID_X509_ATTRIBUTE = 127,
356 CSSM_WORDID_X509V1 = 128,
357 CSSM_WORDID_X509V2 = 129,
358 CSSM_WORDID_X509V3 = 130,
359 CSSM_WORDID_X9_ATTRIBUTE = 131,
360 CSSM_WORDID_VENDOR_START = 0x00010000,
361 CSSM_WORDID_VENDOR_END = 0x7FFF0000
362 };
363
364 typedef uint32 CSSM_LIST_ELEMENT_TYPE, *CSSM_LIST_ELEMENT_TYPE_PTR;
365 enum {
366 CSSM_LIST_ELEMENT_DATUM = 0x00,
367 CSSM_LIST_ELEMENT_SUBLIST = 0x01,
368 CSSM_LIST_ELEMENT_WORDID = 0x02
369 };
370
371 typedef uint32 CSSM_LIST_TYPE, *CSSM_LIST_TYPE_PTR;
372 enum {
373 CSSM_LIST_TYPE_UNKNOWN = 0,
374 CSSM_LIST_TYPE_CUSTOM = 1,
375 CSSM_LIST_TYPE_SEXPR = 2
376 };
377
378 typedef struct cssm_list_element *CSSM_LIST_ELEMENT_PTR;
379
380 typedef struct cssm_list {
381 CSSM_LIST_TYPE ListType; /* type of this list */
382 CSSM_LIST_ELEMENT_PTR Head; /* head of the list */
383 CSSM_LIST_ELEMENT_PTR Tail; /* tail of the list */
384 } CSSM_LIST DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_LIST_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
385
386 typedef struct cssm_list_element {
387 struct cssm_list_element *NextElement; /* next list element */
388 CSSM_WORDID_TYPE WordID; /* integer identifier associated */
389 /* with a Word value */
390 CSSM_LIST_ELEMENT_TYPE ElementType;
391 union {
392 CSSM_LIST Sublist; /* sublist */
393 CSSM_DATA Word; /* a byte-string */
394 } Element;
395 } CSSM_LIST_ELEMENT;
396
397 typedef struct { /* 5-tuple definition */
398 CSSM_LIST Issuer; /* issuer, or empty if ACL */
399 CSSM_LIST Subject; /* subject */
400 CSSM_BOOL Delegate; /* permission to delegate */
401 CSSM_LIST AuthorizationTag; /* authorization field */
402 CSSM_LIST ValidityPeriod; /* validity information (dates) */
403 } CSSM_TUPLE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TUPLE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
404
405 typedef struct cssm_tuplegroup {
406 uint32 NumberOfTuples;
407 CSSM_TUPLE_PTR Tuples;
408 } CSSM_TUPLEGROUP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TUPLEGROUP_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
409
410 typedef CSSM_WORDID_TYPE CSSM_SAMPLE_TYPE;
411 enum {
412 CSSM_SAMPLE_TYPE_PASSWORD = CSSM_WORDID_PASSWORD,
413 CSSM_SAMPLE_TYPE_HASHED_PASSWORD = CSSM_WORDID_HASHED_PASSWORD,
414 CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD,
415 CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD,
416 CSSM_SAMPLE_TYPE_SIGNED_NONCE = CSSM_WORDID_SIGNED_NONCE,
417 CSSM_SAMPLE_TYPE_SIGNED_SECRET = CSSM_WORDID_SIGNED_SECRET,
418 CSSM_SAMPLE_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC,
419 CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC,
420 CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC,
421 CSSM_SAMPLE_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD
422 };
423
424 typedef struct cssm_sample {
425 CSSM_LIST TypedSample;
426 const CSSM_SUBSERVICE_UID *Verifier;
427 } CSSM_SAMPLE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SAMPLE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
428
429 typedef struct cssm_samplegroup {
430 uint32 NumberOfSamples;
431 const CSSM_SAMPLE *Samples;
432 } CSSM_SAMPLEGROUP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SAMPLEGROUP_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
433
434 typedef void *(CSSMAPI *CSSM_MALLOC)
435 (CSSM_SIZE size,
436 void *allocref);
437
438 typedef void (CSSMAPI *CSSM_FREE)
439 (void *memblock,
440 void *allocref);
441
442 typedef void *(CSSMAPI *CSSM_REALLOC)
443 (void *memblock,
444 CSSM_SIZE size,
445 void *allocref);
446
447 typedef void *(CSSMAPI *CSSM_CALLOC)
448 (uint32 num,
449 CSSM_SIZE size,
450 void *allocref);
451
452 typedef struct cssm_memory_funcs {
453 CSSM_MALLOC malloc_func;
454 CSSM_FREE free_func;
455 CSSM_REALLOC realloc_func;
456 CSSM_CALLOC calloc_func;
457 void *AllocRef;
458 } CSSM_MEMORY_FUNCS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_MEMORY_FUNCS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
459
460 typedef CSSM_MEMORY_FUNCS CSSM_API_MEMORY_FUNCS;
461 typedef CSSM_API_MEMORY_FUNCS *CSSM_API_MEMORY_FUNCS_PTR;
462
463 typedef CSSM_RETURN (CSSMAPI * CSSM_CHALLENGE_CALLBACK)
464 (const CSSM_LIST *Challenge,
465 CSSM_SAMPLEGROUP_PTR Response,
466 void *CallerCtx,
467 const CSSM_MEMORY_FUNCS *MemFuncs);
468
469 typedef uint32 CSSM_CERT_TYPE, *CSSM_CERT_TYPE_PTR;
470 enum {
471 CSSM_CERT_UNKNOWN = 0x00,
472 CSSM_CERT_X_509v1 = 0x01,
473 CSSM_CERT_X_509v2 = 0x02,
474 CSSM_CERT_X_509v3 = 0x03,
475 CSSM_CERT_PGP = 0x04,
476 CSSM_CERT_SPKI = 0x05,
477 CSSM_CERT_SDSIv1 = 0x06,
478 CSSM_CERT_Intel = 0x08,
479 CSSM_CERT_X_509_ATTRIBUTE = 0x09, /* X.509 attribute cert */
480 CSSM_CERT_X9_ATTRIBUTE = 0x0A, /* X9 attribute cert */
481 CSSM_CERT_TUPLE = 0x0B,
482 CSSM_CERT_ACL_ENTRY = 0x0C,
483 CSSM_CERT_MULTIPLE = 0x7FFE,
484 CSSM_CERT_LAST = 0x7FFF,
485 /* Applications wishing to define their own custom certificate
486 type should define and publicly document a uint32 value greater
487 than the CSSM_CL_CUSTOM_CERT_TYPE */
488 CSSM_CL_CUSTOM_CERT_TYPE = 0x08000
489 };
490
491 typedef uint32 CSSM_CERT_ENCODING, *CSSM_CERT_ENCODING_PTR;
492 enum {
493 CSSM_CERT_ENCODING_UNKNOWN = 0x00,
494 CSSM_CERT_ENCODING_CUSTOM = 0x01,
495 CSSM_CERT_ENCODING_BER = 0x02,
496 CSSM_CERT_ENCODING_DER = 0x03,
497 CSSM_CERT_ENCODING_NDR = 0x04,
498 CSSM_CERT_ENCODING_SEXPR = 0x05,
499 CSSM_CERT_ENCODING_PGP = 0x06,
500 CSSM_CERT_ENCODING_MULTIPLE = 0x7FFE,
501 CSSM_CERT_ENCODING_LAST = 0x7FFF,
502 /* Applications wishing to define their own custom certificate
503 encoding should create a uint32 value greater than the
504 CSSM_CL_CUSTOM_CERT_ENCODING */
505 CSSM_CL_CUSTOM_CERT_ENCODING = 0x8000
506 };
507
508 typedef struct cssm_encoded_cert {
509 CSSM_CERT_TYPE CertType; /* type of certificate */
510 CSSM_CERT_ENCODING CertEncoding; /* encoding for this packed cert */
511 CSSM_DATA CertBlob; /* packed cert */
512 } CSSM_ENCODED_CERT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ENCODED_CERT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
513
514 typedef uint32 CSSM_CERT_PARSE_FORMAT, *CSSM_CERT_PARSE_FORMAT_PTR;
515 enum {
516 CSSM_CERT_PARSE_FORMAT_NONE = 0x00,
517 CSSM_CERT_PARSE_FORMAT_CUSTOM = 0x01, /* void* */
518 CSSM_CERT_PARSE_FORMAT_SEXPR = 0x02, /* CSSM_LIST */
519 CSSM_CERT_PARSE_FORMAT_COMPLEX = 0x03, /* void* */
520 CSSM_CERT_PARSE_FORMAT_OID_NAMED = 0x04, /* CSSM_FIELDGROUP */
521 CSSM_CERT_PARSE_FORMAT_TUPLE = 0x05, /* CSSM_TUPLE */
522 CSSM_CERT_PARSE_FORMAT_MULTIPLE = 0x7FFE,
523 /* multiple forms, each cert carries a
524 parse format indicator */
525 CSSM_CERT_PARSE_FORMAT_LAST = 0x7FFF,
526 /* Applications wishing to define their
527 own custom parse format should create
528 a * uint32 value greater than the
529 CSSM_CL_CUSTOM_CERT_PARSE_FORMAT */
530 CSSM_CL_CUSTOM_CERT_PARSE_FORMAT = 0x8000
531 };
532
533 typedef struct cssm_parsed_cert {
534 CSSM_CERT_TYPE CertType; /* certificate type */
535 CSSM_CERT_PARSE_FORMAT ParsedCertFormat;
536 /* struct of ParsedCert */
537 void *ParsedCert; /* parsed cert (to be typecast) */
538 } CSSM_PARSED_CERT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_PARSED_CERT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
539
540 typedef struct cssm_cert_pair {
541 CSSM_ENCODED_CERT EncodedCert; /* an encoded certificate blob */
542 CSSM_PARSED_CERT ParsedCert; /* equivalent parsed certificate */
543 } CSSM_CERT_PAIR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CERT_PAIR_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
544
545 typedef uint32 CSSM_CERTGROUP_TYPE, *CSSM_CERTGROUP_TYPE_PTR;
546 enum {
547 CSSM_CERTGROUP_DATA = 0x00,
548 CSSM_CERTGROUP_ENCODED_CERT = 0x01,
549 CSSM_CERTGROUP_PARSED_CERT = 0x02,
550 CSSM_CERTGROUP_CERT_PAIR = 0x03
551 };
552
553 typedef struct cssm_certgroup {
554 CSSM_CERT_TYPE CertType;
555 CSSM_CERT_ENCODING CertEncoding;
556 uint32 NumCerts; /* # of certificates in this list */
557 union {
558 CSSM_DATA_PTR CertList; /* legacy list of single type certificate blobs */
559 CSSM_ENCODED_CERT_PTR EncodedCertList;
560 /* list of multi-type certificate blobs */
561 CSSM_PARSED_CERT_PTR ParsedCertList;
562 /* list of multi-type parsed certs */
563 CSSM_CERT_PAIR_PTR PairCertList;
564 /*list of single or multi-type certs with two representations: blob and parsed */
565 } GroupList;
566 CSSM_CERTGROUP_TYPE CertGroupType;
567 /* type of structure in the GroupList */
568 void *Reserved; /* reserved for implementation dependent use */
569 } CSSM_CERTGROUP, *CSSM_CERTGROUP_PTR;
570
571 typedef struct cssm_base_certs {
572 CSSM_TP_HANDLE TPHandle;
573 CSSM_CL_HANDLE CLHandle;
574 CSSM_CERTGROUP Certs;
575 } CSSM_BASE_CERTS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_BASE_CERTS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
576
577 typedef struct cssm_access_credentials {
578 CSSM_STRING EntryTag;
579 CSSM_BASE_CERTS BaseCerts;
580 CSSM_SAMPLEGROUP Samples;
581 CSSM_CHALLENGE_CALLBACK Callback;
582 void *CallerCtx;
583 } CSSM_ACCESS_CREDENTIALS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACCESS_CREDENTIALS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
584
585 typedef sint32 CSSM_ACL_SUBJECT_TYPE;
586 enum {
587 CSSM_ACL_SUBJECT_TYPE_ANY = CSSM_WORDID__STAR_,
588 CSSM_ACL_SUBJECT_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD,
589 CSSM_ACL_SUBJECT_TYPE_PASSWORD = CSSM_WORDID_PASSWORD,
590 CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD,
591 CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD,
592 CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY = CSSM_WORDID_PUBLIC_KEY,
593 CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT = CSSM_WORDID_HASHED_SUBJECT,
594 CSSM_ACL_SUBJECT_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC,
595 CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC,
596 CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC,
597 CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME = CSSM_WORDID_LOGIN_NAME,
598 CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME = CSSM_WORDID_PAM_NAME
599 };
600
601 /* Authorization tag type */
602 typedef sint32 CSSM_ACL_AUTHORIZATION_TAG;
603 enum {
604 /* All vendor specific constants must be in the number range
605 starting at CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START */
606 CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START = 0x00010000,
607 /* No restrictions. Permission to perform all operations on
608 the resource or available to an ACL owner. */
609 CSSM_ACL_AUTHORIZATION_ANY = CSSM_WORDID__STAR_,
610 /* Defined authorization tag values for CSPs */
611 CSSM_ACL_AUTHORIZATION_LOGIN = CSSM_WORDID_LOGIN,
612 CSSM_ACL_AUTHORIZATION_GENKEY = CSSM_WORDID_GENKEY,
613 CSSM_ACL_AUTHORIZATION_DELETE = CSSM_WORDID_DELETE,
614 CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED = CSSM_WORDID_EXPORT_WRAPPED,
615 CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR = CSSM_WORDID_EXPORT_CLEAR,
616 CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED = CSSM_WORDID_IMPORT_WRAPPED,
617 CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR = CSSM_WORDID_IMPORT_CLEAR,
618 CSSM_ACL_AUTHORIZATION_SIGN = CSSM_WORDID_SIGN,
619 CSSM_ACL_AUTHORIZATION_ENCRYPT = CSSM_WORDID_ENCRYPT,
620 CSSM_ACL_AUTHORIZATION_DECRYPT = CSSM_WORDID_DECRYPT,
621 CSSM_ACL_AUTHORIZATION_MAC = CSSM_WORDID_MAC,
622 CSSM_ACL_AUTHORIZATION_DERIVE = CSSM_WORDID_DERIVE,
623 /* Defined authorization tag values for DLs */
624 CSSM_ACL_AUTHORIZATION_DBS_CREATE = CSSM_WORDID_DBS_CREATE,
625 CSSM_ACL_AUTHORIZATION_DBS_DELETE = CSSM_WORDID_DBS_DELETE,
626 CSSM_ACL_AUTHORIZATION_DB_READ = CSSM_WORDID_DB_READ,
627 CSSM_ACL_AUTHORIZATION_DB_INSERT = CSSM_WORDID_DB_INSERT,
628 CSSM_ACL_AUTHORIZATION_DB_MODIFY = CSSM_WORDID_DB_MODIFY,
629 CSSM_ACL_AUTHORIZATION_DB_DELETE = CSSM_WORDID_DB_DELETE
630 };
631
632 typedef struct cssm_authorizationgroup {
633 uint32 NumberOfAuthTags;
634 CSSM_ACL_AUTHORIZATION_TAG *AuthTags;
635 } CSSM_AUTHORIZATIONGROUP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_AUTHORIZATIONGROUP_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
636
637 typedef struct cssm_acl_validity_period {
638 CSSM_DATA StartDate;
639 CSSM_DATA EndDate;
640 } CSSM_ACL_VALIDITY_PERIOD DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACL_VALIDITY_PERIOD_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
641
642 typedef struct cssm_acl_entry_prototype {
643 CSSM_LIST TypedSubject;
644 CSSM_BOOL Delegate;
645 CSSM_AUTHORIZATIONGROUP Authorization;
646 CSSM_ACL_VALIDITY_PERIOD TimeRange;
647 CSSM_STRING EntryTag;
648 } CSSM_ACL_ENTRY_PROTOTYPE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACL_ENTRY_PROTOTYPE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
649
650 typedef struct cssm_acl_owner_prototype {
651 CSSM_LIST TypedSubject;
652 CSSM_BOOL Delegate;
653 } CSSM_ACL_OWNER_PROTOTYPE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACL_OWNER_PROTOTYPE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
654
655 typedef CSSM_RETURN (CSSMAPI * CSSM_ACL_SUBJECT_CALLBACK)
656 (const CSSM_LIST *SubjectRequest,
657 CSSM_LIST_PTR SubjectResponse,
658 void *CallerContext,
659 const CSSM_MEMORY_FUNCS *MemFuncs);
660
661 typedef struct cssm_acl_entry_input {
662 CSSM_ACL_ENTRY_PROTOTYPE Prototype;
663 CSSM_ACL_SUBJECT_CALLBACK Callback;
664 void *CallerContext;
665 } CSSM_ACL_ENTRY_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACL_ENTRY_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
666
667 typedef struct cssm_resource_control_context {
668 CSSM_ACCESS_CREDENTIALS_PTR AccessCred;
669 CSSM_ACL_ENTRY_INPUT InitialAclEntry;
670 } CSSM_RESOURCE_CONTROL_CONTEXT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_RESOURCE_CONTROL_CONTEXT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
671
672 typedef CSSM_HANDLE CSSM_ACL_HANDLE;
673
674 typedef struct cssm_acl_entry_info {
675 CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo;
676 CSSM_ACL_HANDLE EntryHandle;
677 } CSSM_ACL_ENTRY_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACL_ENTRY_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
678
679 typedef uint32 CSSM_ACL_EDIT_MODE;
680 enum {
681 CSSM_ACL_EDIT_MODE_ADD = 1,
682 CSSM_ACL_EDIT_MODE_DELETE = 2,
683 CSSM_ACL_EDIT_MODE_REPLACE = 3
684 };
685
686 typedef struct cssm_acl_edit {
687 CSSM_ACL_EDIT_MODE EditMode;
688 CSSM_ACL_HANDLE OldEntryHandle;
689 const CSSM_ACL_ENTRY_INPUT *NewEntry;
690 } CSSM_ACL_EDIT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ACL_EDIT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
691
692 #if defined(WIN32)
693 typedef FARPROC CSSM_PROC_ADDR;
694 #else
695 typedef void (CSSMAPI *CSSM_PROC_ADDR) ();
696 #endif
697 typedef CSSM_PROC_ADDR *CSSM_PROC_ADDR_PTR;
698
699 typedef struct cssm_func_name_addr {
700 CSSM_STRING Name;
701 CSSM_PROC_ADDR Address;
702 } CSSM_FUNC_NAME_ADDR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_FUNC_NAME_ADDR_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
703
704
705 /* Data Types for Cryptographic Services */
706
707 typedef struct cssm_date {
708 uint8 Year[4];
709 uint8 Month[2];
710 uint8 Day[2];
711 } CSSM_DATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DATE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
712
713 typedef struct cssm_range {
714 uint32 Min; /* inclusive minimum value */
715 uint32 Max; /* inclusive maximum value */
716 } CSSM_RANGE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_RANGE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
717
718 typedef struct cssm_query_size_data {
719 uint32 SizeInputBlock; /* size of input data block */
720 uint32 SizeOutputBlock; /* size of resulting output data block */
721 } CSSM_QUERY_SIZE_DATA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_QUERY_SIZE_DATA_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
722
723 typedef uint32 CSSM_HEADERVERSION;
724 enum {
725 CSSM_KEYHEADER_VERSION = 2
726 };
727
728 typedef struct cssm_key_size {
729 uint32 LogicalKeySizeInBits; /* Logical key size in bits */
730 uint32 EffectiveKeySizeInBits; /* Effective key size in bits */
731 } CSSM_KEY_SIZE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KEY_SIZE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
732
733 typedef uint32 CSSM_KEYBLOB_TYPE;
734 enum {
735 CSSM_KEYBLOB_RAW = 0, /* The blob is a clear, raw key */
736 CSSM_KEYBLOB_REFERENCE = 2, /* The blob is a reference to a key */
737 CSSM_KEYBLOB_WRAPPED = 3, /* The blob is a wrapped RAW key */
738 CSSM_KEYBLOB_OTHER = 0xFFFFFFFF
739 };
740
741 typedef uint32 CSSM_KEYBLOB_FORMAT;
742 enum {
743 /* Raw Format */
744 CSSM_KEYBLOB_RAW_FORMAT_NONE = 0,
745 /* No further conversion need to be done */
746 CSSM_KEYBLOB_RAW_FORMAT_PKCS1 = 1, /* RSA PKCS1 V1.5 */
747 CSSM_KEYBLOB_RAW_FORMAT_PKCS3 = 2, /* RSA PKCS3 V1.5 */
748 CSSM_KEYBLOB_RAW_FORMAT_MSCAPI = 3, /* Microsoft CAPI V2.0 */
749 CSSM_KEYBLOB_RAW_FORMAT_PGP = 4, /* PGP V */
750 CSSM_KEYBLOB_RAW_FORMAT_FIPS186 = 5, /* US Gov. FIPS 186 - DSS V */
751 CSSM_KEYBLOB_RAW_FORMAT_BSAFE = 6, /* RSA Bsafe V3.0 */
752 CSSM_KEYBLOB_RAW_FORMAT_CCA = 9, /* CCA clear public key blob */
753 CSSM_KEYBLOB_RAW_FORMAT_PKCS8 = 10, /* RSA PKCS8 V1.2 */
754 CSSM_KEYBLOB_RAW_FORMAT_SPKI = 11, /* SPKI Specification */
755 CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING = 12,
756 CSSM_KEYBLOB_RAW_FORMAT_OTHER = 0xFFFFFFFF /* Other, CSP defined */
757 };
758 enum {
759 /* Wrapped Format */
760 CSSM_KEYBLOB_WRAPPED_FORMAT_NONE = 0,
761 /* No further conversion need to be done */
762 CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS8 = 1, /* RSA PKCS8 V1.2 */
763 CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS7 = 2,
764 CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI = 3,
765 CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER = 0xFFFFFFFF /* Other, CSP defined */
766 };
767 enum {
768 /* Reference Format */
769 CSSM_KEYBLOB_REF_FORMAT_INTEGER = 0, /* Reference is a number or handle */
770 CSSM_KEYBLOB_REF_FORMAT_STRING = 1, /* Reference is a string or label */
771 CSSM_KEYBLOB_REF_FORMAT_SPKI = 2, /* Reference is an SPKI S-expression */
772 /* to be evaluated to locate the key */
773 CSSM_KEYBLOB_REF_FORMAT_OTHER = 0xFFFFFFFF /* Other, CSP defined */
774 };
775
776 typedef uint32 CSSM_KEYCLASS;
777 enum {
778 CSSM_KEYCLASS_PUBLIC_KEY = 0, /* Key is public key */
779 CSSM_KEYCLASS_PRIVATE_KEY = 1, /* Key is private key */
780 CSSM_KEYCLASS_SESSION_KEY = 2, /* Key is session or symmetric key */
781 CSSM_KEYCLASS_SECRET_PART = 3, /* Key is part of secret key */
782 CSSM_KEYCLASS_OTHER = 0xFFFFFFFF /* Other */
783 };
784
785 typedef uint32 CSSM_KEYATTR_FLAGS;
786 enum {
787 /* Valid only during call to an API. Will never be valid when set in a key header */
788 CSSM_KEYATTR_RETURN_DEFAULT = 0x00000000,
789 CSSM_KEYATTR_RETURN_DATA = 0x10000000,
790 CSSM_KEYATTR_RETURN_REF = 0x20000000,
791 CSSM_KEYATTR_RETURN_NONE = 0x40000000,
792 /* Valid during an API call and in a key header */
793 CSSM_KEYATTR_PERMANENT = 0x00000001,
794 CSSM_KEYATTR_PRIVATE = 0x00000002,
795 CSSM_KEYATTR_MODIFIABLE = 0x00000004,
796 CSSM_KEYATTR_SENSITIVE = 0x00000008,
797 CSSM_KEYATTR_EXTRACTABLE = 0x00000020,
798 /* Valid only in a key header generated by a CSP, not valid during an API call */
799 CSSM_KEYATTR_ALWAYS_SENSITIVE = 0x00000010,
800 CSSM_KEYATTR_NEVER_EXTRACTABLE = 0x00000040
801 };
802
803 typedef uint32 CSSM_KEYUSE;
804 enum {
805 CSSM_KEYUSE_ANY = 0x80000000,
806 CSSM_KEYUSE_ENCRYPT = 0x00000001,
807 CSSM_KEYUSE_DECRYPT = 0x00000002,
808 CSSM_KEYUSE_SIGN = 0x00000004,
809 CSSM_KEYUSE_VERIFY = 0x00000008,
810 CSSM_KEYUSE_SIGN_RECOVER = 0x00000010,
811 CSSM_KEYUSE_VERIFY_RECOVER = 0x00000020,
812 CSSM_KEYUSE_WRAP = 0x00000040,
813 CSSM_KEYUSE_UNWRAP = 0x00000080,
814 CSSM_KEYUSE_DERIVE = 0x00000100
815 };
816
817 typedef uint32 CSSM_ALGORITHMS;
818 enum {
819 CSSM_ALGID_NONE = 0,
820 CSSM_ALGID_CUSTOM = CSSM_ALGID_NONE + 1,
821 CSSM_ALGID_DH = CSSM_ALGID_NONE + 2,
822 CSSM_ALGID_PH = CSSM_ALGID_NONE + 3,
823 CSSM_ALGID_KEA = CSSM_ALGID_NONE + 4,
824 CSSM_ALGID_MD2 = CSSM_ALGID_NONE + 5,
825 CSSM_ALGID_MD4 = CSSM_ALGID_NONE + 6,
826 CSSM_ALGID_MD5 = CSSM_ALGID_NONE + 7,
827 CSSM_ALGID_SHA1 = CSSM_ALGID_NONE + 8,
828 CSSM_ALGID_NHASH = CSSM_ALGID_NONE + 9,
829 CSSM_ALGID_HAVAL = CSSM_ALGID_NONE + 10,
830 CSSM_ALGID_RIPEMD = CSSM_ALGID_NONE + 11,
831 CSSM_ALGID_IBCHASH = CSSM_ALGID_NONE + 12,
832 CSSM_ALGID_RIPEMAC = CSSM_ALGID_NONE + 13,
833 CSSM_ALGID_DES = CSSM_ALGID_NONE + 14,
834 CSSM_ALGID_DESX = CSSM_ALGID_NONE + 15,
835 CSSM_ALGID_RDES = CSSM_ALGID_NONE + 16,
836 CSSM_ALGID_3DES_3KEY_EDE = CSSM_ALGID_NONE + 17,
837 CSSM_ALGID_3DES_2KEY_EDE = CSSM_ALGID_NONE + 18,
838 CSSM_ALGID_3DES_1KEY_EEE = CSSM_ALGID_NONE + 19,
839 CSSM_ALGID_3DES_3KEY = CSSM_ALGID_3DES_3KEY_EDE,
840 CSSM_ALGID_3DES_3KEY_EEE = CSSM_ALGID_NONE + 20,
841 CSSM_ALGID_3DES_2KEY = CSSM_ALGID_3DES_2KEY_EDE,
842 CSSM_ALGID_3DES_2KEY_EEE = CSSM_ALGID_NONE + 21,
843 CSSM_ALGID_3DES_1KEY = CSSM_ALGID_3DES_3KEY_EEE,
844 CSSM_ALGID_IDEA = CSSM_ALGID_NONE + 22,
845 CSSM_ALGID_RC2 = CSSM_ALGID_NONE + 23,
846 CSSM_ALGID_RC5 = CSSM_ALGID_NONE + 24,
847 CSSM_ALGID_RC4 = CSSM_ALGID_NONE + 25,
848 CSSM_ALGID_SEAL = CSSM_ALGID_NONE + 26,
849 CSSM_ALGID_CAST = CSSM_ALGID_NONE + 27,
850 CSSM_ALGID_BLOWFISH = CSSM_ALGID_NONE + 28,
851 CSSM_ALGID_SKIPJACK = CSSM_ALGID_NONE + 29,
852 CSSM_ALGID_LUCIFER = CSSM_ALGID_NONE + 30,
853 CSSM_ALGID_MADRYGA = CSSM_ALGID_NONE + 31,
854 CSSM_ALGID_FEAL = CSSM_ALGID_NONE + 32,
855 CSSM_ALGID_REDOC = CSSM_ALGID_NONE + 33,
856 CSSM_ALGID_REDOC3 = CSSM_ALGID_NONE + 34,
857 CSSM_ALGID_LOKI = CSSM_ALGID_NONE + 35,
858 CSSM_ALGID_KHUFU = CSSM_ALGID_NONE + 36,
859 CSSM_ALGID_KHAFRE = CSSM_ALGID_NONE + 37,
860 CSSM_ALGID_MMB = CSSM_ALGID_NONE + 38,
861 CSSM_ALGID_GOST = CSSM_ALGID_NONE + 39,
862 CSSM_ALGID_SAFER = CSSM_ALGID_NONE + 40,
863 CSSM_ALGID_CRAB = CSSM_ALGID_NONE + 41,
864 CSSM_ALGID_RSA = CSSM_ALGID_NONE + 42,
865 CSSM_ALGID_DSA = CSSM_ALGID_NONE + 43,
866 CSSM_ALGID_MD5WithRSA = CSSM_ALGID_NONE + 44,
867 CSSM_ALGID_MD2WithRSA = CSSM_ALGID_NONE + 45,
868 CSSM_ALGID_ElGamal = CSSM_ALGID_NONE + 46,
869 CSSM_ALGID_MD2Random = CSSM_ALGID_NONE + 47,
870 CSSM_ALGID_MD5Random = CSSM_ALGID_NONE + 48,
871 CSSM_ALGID_SHARandom = CSSM_ALGID_NONE + 49,
872 CSSM_ALGID_DESRandom = CSSM_ALGID_NONE + 50,
873 CSSM_ALGID_SHA1WithRSA = CSSM_ALGID_NONE + 51,
874 CSSM_ALGID_CDMF = CSSM_ALGID_NONE + 52,
875 CSSM_ALGID_CAST3 = CSSM_ALGID_NONE + 53,
876 CSSM_ALGID_CAST5 = CSSM_ALGID_NONE + 54,
877 CSSM_ALGID_GenericSecret = CSSM_ALGID_NONE + 55,
878 CSSM_ALGID_ConcatBaseAndKey = CSSM_ALGID_NONE + 56,
879 CSSM_ALGID_ConcatKeyAndBase = CSSM_ALGID_NONE + 57,
880 CSSM_ALGID_ConcatBaseAndData = CSSM_ALGID_NONE + 58,
881 CSSM_ALGID_ConcatDataAndBase = CSSM_ALGID_NONE + 59,
882 CSSM_ALGID_XORBaseAndData = CSSM_ALGID_NONE + 60,
883 CSSM_ALGID_ExtractFromKey = CSSM_ALGID_NONE + 61,
884 CSSM_ALGID_SSL3PreMasterGen = CSSM_ALGID_NONE + 62,
885 CSSM_ALGID_SSL3MasterDerive = CSSM_ALGID_NONE + 63,
886 CSSM_ALGID_SSL3KeyAndMacDerive = CSSM_ALGID_NONE + 64,
887 CSSM_ALGID_SSL3MD5_MAC = CSSM_ALGID_NONE + 65,
888 CSSM_ALGID_SSL3SHA1_MAC = CSSM_ALGID_NONE + 66,
889 CSSM_ALGID_PKCS5_PBKDF1_MD5 = CSSM_ALGID_NONE + 67,
890 CSSM_ALGID_PKCS5_PBKDF1_MD2 = CSSM_ALGID_NONE + 68,
891 CSSM_ALGID_PKCS5_PBKDF1_SHA1 = CSSM_ALGID_NONE + 69,
892 CSSM_ALGID_WrapLynks = CSSM_ALGID_NONE + 70,
893 CSSM_ALGID_WrapSET_OAEP = CSSM_ALGID_NONE + 71,
894 CSSM_ALGID_BATON = CSSM_ALGID_NONE + 72,
895 CSSM_ALGID_ECDSA = CSSM_ALGID_NONE + 73,
896 CSSM_ALGID_MAYFLY = CSSM_ALGID_NONE + 74,
897 CSSM_ALGID_JUNIPER = CSSM_ALGID_NONE + 75,
898 CSSM_ALGID_FASTHASH = CSSM_ALGID_NONE + 76,
899 CSSM_ALGID_3DES = CSSM_ALGID_NONE + 77,
900 CSSM_ALGID_SSL3MD5 = CSSM_ALGID_NONE + 78,
901 CSSM_ALGID_SSL3SHA1 = CSSM_ALGID_NONE + 79,
902 CSSM_ALGID_FortezzaTimestamp = CSSM_ALGID_NONE + 80,
903 CSSM_ALGID_SHA1WithDSA = CSSM_ALGID_NONE + 81,
904 CSSM_ALGID_SHA1WithECDSA = CSSM_ALGID_NONE + 82,
905 CSSM_ALGID_DSA_BSAFE = CSSM_ALGID_NONE + 83,
906 CSSM_ALGID_ECDH = CSSM_ALGID_NONE + 84,
907 CSSM_ALGID_ECMQV = CSSM_ALGID_NONE + 85,
908 CSSM_ALGID_PKCS12_SHA1_PBE = CSSM_ALGID_NONE + 86,
909 CSSM_ALGID_ECNRA = CSSM_ALGID_NONE + 87,
910 CSSM_ALGID_SHA1WithECNRA = CSSM_ALGID_NONE + 88,
911 CSSM_ALGID_ECES = CSSM_ALGID_NONE + 89,
912 CSSM_ALGID_ECAES = CSSM_ALGID_NONE + 90,
913 CSSM_ALGID_SHA1HMAC = CSSM_ALGID_NONE + 91,
914 CSSM_ALGID_FIPS186Random = CSSM_ALGID_NONE + 92,
915 CSSM_ALGID_ECC = CSSM_ALGID_NONE + 93,
916 CSSM_ALGID_MQV = CSSM_ALGID_NONE + 94,
917 CSSM_ALGID_NRA = CSSM_ALGID_NONE + 95,
918 CSSM_ALGID_IntelPlatformRandom = CSSM_ALGID_NONE + 96,
919 CSSM_ALGID_UTC = CSSM_ALGID_NONE + 97,
920 CSSM_ALGID_HAVAL3 = CSSM_ALGID_NONE + 98,
921 CSSM_ALGID_HAVAL4 = CSSM_ALGID_NONE + 99,
922 CSSM_ALGID_HAVAL5 = CSSM_ALGID_NONE + 100,
923 CSSM_ALGID_TIGER = CSSM_ALGID_NONE + 101,
924 CSSM_ALGID_MD5HMAC = CSSM_ALGID_NONE + 102,
925 CSSM_ALGID_PKCS5_PBKDF2 = CSSM_ALGID_NONE + 103,
926 CSSM_ALGID_RUNNING_COUNTER = CSSM_ALGID_NONE + 104,
927 CSSM_ALGID_LAST = CSSM_ALGID_NONE + 0x7FFFFFFF,
928 /* All algorithms IDs that are vendor specific, and not
929 part of the CSSM specification should be defined relative
930 to CSSM_ALGID_VENDOR_DEFINED. */
931 CSSM_ALGID_VENDOR_DEFINED = CSSM_ALGID_NONE + 0x80000000
932 };
933
934 typedef uint32 CSSM_ENCRYPT_MODE;
935 enum {
936 CSSM_ALGMODE_NONE = 0,
937 CSSM_ALGMODE_CUSTOM = CSSM_ALGMODE_NONE + 1,
938 CSSM_ALGMODE_ECB = CSSM_ALGMODE_NONE + 2,
939 CSSM_ALGMODE_ECBPad = CSSM_ALGMODE_NONE + 3,
940 CSSM_ALGMODE_CBC = CSSM_ALGMODE_NONE + 4,
941 CSSM_ALGMODE_CBC_IV8 = CSSM_ALGMODE_NONE + 5,
942 CSSM_ALGMODE_CBCPadIV8 = CSSM_ALGMODE_NONE + 6,
943 CSSM_ALGMODE_CFB = CSSM_ALGMODE_NONE + 7,
944 CSSM_ALGMODE_CFB_IV8 = CSSM_ALGMODE_NONE + 8,
945 CSSM_ALGMODE_CFBPadIV8 = CSSM_ALGMODE_NONE + 9,
946 CSSM_ALGMODE_OFB = CSSM_ALGMODE_NONE + 10,
947 CSSM_ALGMODE_OFB_IV8 = CSSM_ALGMODE_NONE + 11,
948 CSSM_ALGMODE_OFBPadIV8 = CSSM_ALGMODE_NONE + 12,
949 CSSM_ALGMODE_COUNTER = CSSM_ALGMODE_NONE + 13,
950 CSSM_ALGMODE_BC = CSSM_ALGMODE_NONE + 14,
951 CSSM_ALGMODE_PCBC = CSSM_ALGMODE_NONE + 15,
952 CSSM_ALGMODE_CBCC = CSSM_ALGMODE_NONE + 16,
953 CSSM_ALGMODE_OFBNLF = CSSM_ALGMODE_NONE + 17,
954 CSSM_ALGMODE_PBC = CSSM_ALGMODE_NONE + 18,
955 CSSM_ALGMODE_PFB = CSSM_ALGMODE_NONE + 19,
956 CSSM_ALGMODE_CBCPD = CSSM_ALGMODE_NONE + 20,
957 CSSM_ALGMODE_PUBLIC_KEY = CSSM_ALGMODE_NONE + 21,
958 CSSM_ALGMODE_PRIVATE_KEY = CSSM_ALGMODE_NONE + 22,
959 CSSM_ALGMODE_SHUFFLE = CSSM_ALGMODE_NONE + 23,
960 CSSM_ALGMODE_ECB64 = CSSM_ALGMODE_NONE + 24,
961 CSSM_ALGMODE_CBC64 = CSSM_ALGMODE_NONE + 25,
962 CSSM_ALGMODE_OFB64 = CSSM_ALGMODE_NONE + 26,
963 CSSM_ALGMODE_CFB32 = CSSM_ALGMODE_NONE + 28,
964 CSSM_ALGMODE_CFB16 = CSSM_ALGMODE_NONE + 29,
965 CSSM_ALGMODE_CFB8 = CSSM_ALGMODE_NONE + 30,
966 CSSM_ALGMODE_WRAP = CSSM_ALGMODE_NONE + 31,
967 CSSM_ALGMODE_PRIVATE_WRAP = CSSM_ALGMODE_NONE + 32,
968 CSSM_ALGMODE_RELAYX = CSSM_ALGMODE_NONE + 33,
969 CSSM_ALGMODE_ECB128 = CSSM_ALGMODE_NONE + 34,
970 CSSM_ALGMODE_ECB96 = CSSM_ALGMODE_NONE + 35,
971 CSSM_ALGMODE_CBC128 = CSSM_ALGMODE_NONE + 36,
972 CSSM_ALGMODE_OAEP_HASH = CSSM_ALGMODE_NONE + 37,
973 CSSM_ALGMODE_PKCS1_EME_V15 = CSSM_ALGMODE_NONE + 38,
974 CSSM_ALGMODE_PKCS1_EME_OAEP = CSSM_ALGMODE_NONE + 39,
975 CSSM_ALGMODE_PKCS1_EMSA_V15 = CSSM_ALGMODE_NONE + 40,
976 CSSM_ALGMODE_ISO_9796 = CSSM_ALGMODE_NONE + 41,
977 CSSM_ALGMODE_X9_31 = CSSM_ALGMODE_NONE + 42,
978 CSSM_ALGMODE_LAST = CSSM_ALGMODE_NONE + 0x7FFFFFFF,
979 /* All algorithms modes that are vendor specific, and
980 not part of the CSSM specification should be defined
981 relative to CSSM_ALGMODE_VENDOR_DEFINED. */
982 CSSM_ALGMODE_VENDOR_DEFINED = CSSM_ALGMODE_NONE + 0x80000000
983 };
984
985 typedef struct cssm_keyheader {
986 CSSM_HEADERVERSION HeaderVersion; /* Key header version */
987 CSSM_GUID CspId; /* GUID of CSP generating the key */
988 CSSM_KEYBLOB_TYPE BlobType; /* See BlobType enum */
989 CSSM_KEYBLOB_FORMAT Format; /* Raw or Reference format */
990 CSSM_ALGORITHMS AlgorithmId; /* Algorithm ID of key */
991 CSSM_KEYCLASS KeyClass; /* Public/Private/Secret, etc. */
992 uint32 LogicalKeySizeInBits; /* Logical key size in bits */
993 CSSM_KEYATTR_FLAGS KeyAttr; /* Attribute flags */
994 CSSM_KEYUSE KeyUsage; /* Key use flags */
995 CSSM_DATE StartDate; /* Effective date of key */
996 CSSM_DATE EndDate; /* Expiration date of key */
997 CSSM_ALGORITHMS WrapAlgorithmId; /* == CSSM_ALGID_NONE if clear key */
998 CSSM_ENCRYPT_MODE WrapMode; /* if alg supports multiple wrapping modes */
999 uint32 Reserved;
1000 } CSSM_KEYHEADER DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KEYHEADER_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1001
1002 typedef struct cssm_key {
1003 CSSM_KEYHEADER KeyHeader; /* Fixed length key header */
1004 CSSM_DATA KeyData; /* Variable length key data */
1005 } CSSM_KEY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KEY_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1006
1007 typedef CSSM_KEY CSSM_WRAP_KEY, *CSSM_WRAP_KEY_PTR;
1008
1009 typedef uint32 CSSM_CSPTYPE;
1010 enum {
1011 CSSM_CSP_SOFTWARE = 1,
1012 CSSM_CSP_HARDWARE = CSSM_CSP_SOFTWARE + 1,
1013 CSSM_CSP_HYBRID = CSSM_CSP_SOFTWARE + 2
1014 };
1015
1016 /* From DL. */
1017 typedef struct cssm_dl_db_handle {
1018 CSSM_DL_HANDLE DLHandle;
1019 CSSM_DB_HANDLE DBHandle;
1020 } CSSM_DL_DB_HANDLE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DL_DB_HANDLE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1021
1022 typedef uint32 CSSM_CONTEXT_TYPE;
1023 enum {
1024 CSSM_ALGCLASS_NONE = 0,
1025 CSSM_ALGCLASS_CUSTOM = CSSM_ALGCLASS_NONE + 1,
1026 CSSM_ALGCLASS_SIGNATURE = CSSM_ALGCLASS_NONE + 2,
1027 CSSM_ALGCLASS_SYMMETRIC = CSSM_ALGCLASS_NONE + 3,
1028 CSSM_ALGCLASS_DIGEST = CSSM_ALGCLASS_NONE + 4,
1029 CSSM_ALGCLASS_RANDOMGEN = CSSM_ALGCLASS_NONE + 5,
1030 CSSM_ALGCLASS_UNIQUEGEN = CSSM_ALGCLASS_NONE + 6,
1031 CSSM_ALGCLASS_MAC = CSSM_ALGCLASS_NONE + 7,
1032 CSSM_ALGCLASS_ASYMMETRIC = CSSM_ALGCLASS_NONE + 8,
1033 CSSM_ALGCLASS_KEYGEN = CSSM_ALGCLASS_NONE + 9,
1034 CSSM_ALGCLASS_DERIVEKEY = CSSM_ALGCLASS_NONE + 10
1035 };
1036
1037 /* Attribute data type tags */
1038 enum {
1039 CSSM_ATTRIBUTE_DATA_NONE = 0x00000000,
1040 CSSM_ATTRIBUTE_DATA_UINT32 = 0x10000000,
1041 CSSM_ATTRIBUTE_DATA_CSSM_DATA = 0x20000000,
1042 CSSM_ATTRIBUTE_DATA_CRYPTO_DATA = 0x30000000,
1043 CSSM_ATTRIBUTE_DATA_KEY = 0x40000000,
1044 CSSM_ATTRIBUTE_DATA_STRING = 0x50000000,
1045 CSSM_ATTRIBUTE_DATA_DATE = 0x60000000,
1046 CSSM_ATTRIBUTE_DATA_RANGE = 0x70000000,
1047 CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS = 0x80000000,
1048 CSSM_ATTRIBUTE_DATA_VERSION = 0x01000000,
1049 CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE = 0x02000000,
1050 CSSM_ATTRIBUTE_DATA_KR_PROFILE = 0x03000000,
1051 CSSM_ATTRIBUTE_TYPE_MASK = 0xFF000000
1052 };
1053
1054 typedef uint32 CSSM_ATTRIBUTE_TYPE;
1055 enum {
1056 CSSM_ATTRIBUTE_NONE = 0,
1057 CSSM_ATTRIBUTE_CUSTOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 1,
1058 CSSM_ATTRIBUTE_DESCRIPTION = CSSM_ATTRIBUTE_DATA_STRING | 2,
1059 CSSM_ATTRIBUTE_KEY = CSSM_ATTRIBUTE_DATA_KEY | 3,
1060 CSSM_ATTRIBUTE_INIT_VECTOR = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 4,
1061 CSSM_ATTRIBUTE_SALT = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 5,
1062 CSSM_ATTRIBUTE_PADDING = CSSM_ATTRIBUTE_DATA_UINT32 | 6,
1063 CSSM_ATTRIBUTE_RANDOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 7,
1064 CSSM_ATTRIBUTE_SEED = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA | 8,
1065 CSSM_ATTRIBUTE_PASSPHRASE = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA | 9,
1066 CSSM_ATTRIBUTE_KEY_LENGTH = CSSM_ATTRIBUTE_DATA_UINT32 | 10,
1067 CSSM_ATTRIBUTE_KEY_LENGTH_RANGE = CSSM_ATTRIBUTE_DATA_RANGE | 11,
1068 CSSM_ATTRIBUTE_BLOCK_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 12,
1069 CSSM_ATTRIBUTE_OUTPUT_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 13,
1070 CSSM_ATTRIBUTE_ROUNDS = CSSM_ATTRIBUTE_DATA_UINT32 | 14,
1071 CSSM_ATTRIBUTE_IV_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 | 15,
1072 CSSM_ATTRIBUTE_ALG_PARAMS = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 16,
1073 CSSM_ATTRIBUTE_LABEL = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 17,
1074 CSSM_ATTRIBUTE_KEY_TYPE = CSSM_ATTRIBUTE_DATA_UINT32 | 18,
1075 CSSM_ATTRIBUTE_MODE = CSSM_ATTRIBUTE_DATA_UINT32 | 19,
1076 CSSM_ATTRIBUTE_EFFECTIVE_BITS = CSSM_ATTRIBUTE_DATA_UINT32 | 20,
1077 CSSM_ATTRIBUTE_START_DATE = CSSM_ATTRIBUTE_DATA_DATE | 21,
1078 CSSM_ATTRIBUTE_END_DATE = CSSM_ATTRIBUTE_DATA_DATE | 22,
1079 CSSM_ATTRIBUTE_KEYUSAGE = CSSM_ATTRIBUTE_DATA_UINT32 | 23,
1080 CSSM_ATTRIBUTE_KEYATTR = CSSM_ATTRIBUTE_DATA_UINT32 | 24,
1081 CSSM_ATTRIBUTE_VERSION = CSSM_ATTRIBUTE_DATA_VERSION | 25,
1082 CSSM_ATTRIBUTE_PRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 26,
1083 CSSM_ATTRIBUTE_BASE = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 27,
1084 CSSM_ATTRIBUTE_SUBPRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA | 28,
1085 CSSM_ATTRIBUTE_ALG_ID = CSSM_ATTRIBUTE_DATA_UINT32 | 29,
1086 CSSM_ATTRIBUTE_ITERATION_COUNT = CSSM_ATTRIBUTE_DATA_UINT32 | 30,
1087 CSSM_ATTRIBUTE_ROUNDS_RANGE = CSSM_ATTRIBUTE_DATA_RANGE | 31,
1088 CSSM_ATTRIBUTE_KRPROFILE_LOCAL = CSSM_ATTRIBUTE_DATA_KR_PROFILE | 32,
1089 CSSM_ATTRIBUTE_KRPROFILE_REMOTE = CSSM_ATTRIBUTE_DATA_KR_PROFILE | 33,
1090 CSSM_ATTRIBUTE_CSP_HANDLE = CSSM_ATTRIBUTE_DATA_UINT32 | 34,
1091 CSSM_ATTRIBUTE_DL_DB_HANDLE = CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE | 35,
1092 CSSM_ATTRIBUTE_ACCESS_CREDENTIALS = CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS | 36,
1093 CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 37,
1094 CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 38,
1095 CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT=CSSM_ATTRIBUTE_DATA_UINT32 | 39,
1096 CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 | 40
1097 };
1098
1099 typedef uint32 CSSM_PADDING;
1100 enum {
1101 CSSM_PADDING_NONE = 0,
1102 CSSM_PADDING_CUSTOM = CSSM_PADDING_NONE + 1,
1103 CSSM_PADDING_ZERO = CSSM_PADDING_NONE + 2,
1104 CSSM_PADDING_ONE = CSSM_PADDING_NONE + 3,
1105 CSSM_PADDING_ALTERNATE = CSSM_PADDING_NONE + 4,
1106 CSSM_PADDING_FF = CSSM_PADDING_NONE + 5,
1107 CSSM_PADDING_PKCS5 = CSSM_PADDING_NONE + 6,
1108 CSSM_PADDING_PKCS7 = CSSM_PADDING_NONE + 7,
1109 CSSM_PADDING_CIPHERSTEALING = CSSM_PADDING_NONE + 8,
1110 CSSM_PADDING_RANDOM = CSSM_PADDING_NONE + 9,
1111 CSSM_PADDING_PKCS1 = CSSM_PADDING_NONE + 10,
1112 /* All padding types that are vendor specific, and not
1113 part of the CSSM specification should be defined
1114 relative to CSSM_PADDING_VENDOR_DEFINED. */
1115 CSSM_PADDING_VENDOR_DEFINED = CSSM_PADDING_NONE + 0x80000000
1116 };
1117
1118 typedef CSSM_ALGORITHMS CSSM_KEY_TYPE;
1119
1120 typedef struct cssm_context_attribute {
1121 CSSM_ATTRIBUTE_TYPE AttributeType;
1122 uint32 AttributeLength;
1123 union cssm_context_attribute_value {
1124 char *String;
1125 uint32 Uint32;
1126 CSSM_ACCESS_CREDENTIALS_PTR AccessCredentials;
1127 CSSM_KEY_PTR Key;
1128 CSSM_DATA_PTR Data;
1129 CSSM_PADDING Padding;
1130 CSSM_DATE_PTR Date;
1131 CSSM_RANGE_PTR Range;
1132 CSSM_CRYPTO_DATA_PTR CryptoData;
1133 CSSM_VERSION_PTR Version;
1134 CSSM_DL_DB_HANDLE_PTR DLDBHandle;
1135 struct cssm_kr_profile *KRProfile;
1136 } Attribute;
1137 } CSSM_CONTEXT_ATTRIBUTE, *CSSM_CONTEXT_ATTRIBUTE_PTR;
1138
1139 typedef struct cssm_context {
1140 CSSM_CONTEXT_TYPE ContextType;
1141 CSSM_ALGORITHMS AlgorithmType;
1142 uint32 NumberOfAttributes;
1143 CSSM_CONTEXT_ATTRIBUTE_PTR ContextAttributes;
1144 CSSM_CSP_HANDLE CSPHandle;
1145 CSSM_BOOL Privileged;
1146 uint32 /*CSSM_KR_POLICY_FLAGS*/ EncryptionProhibited;
1147 uint32 WorkFactor;
1148 uint32 Reserved; /* reserved for future use */
1149 } CSSM_CONTEXT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CONTEXT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1150
1151 typedef uint32 CSSM_SC_FLAGS;
1152 enum {
1153 CSSM_CSP_TOK_RNG = 0x00000001,
1154 CSSM_CSP_TOK_CLOCK_EXISTS = 0x00000040
1155 };
1156
1157 typedef uint32 CSSM_CSP_READER_FLAGS;
1158 enum {
1159 CSSM_CSP_RDR_TOKENPRESENT = 0x00000001,
1160 /* Token is present in reader/slot */
1161 CSSM_CSP_RDR_EXISTS = 0x00000002,
1162 /* Device is a reader with a
1163 removable token */
1164 CSSM_CSP_RDR_HW = 0x00000004
1165 /* Slot is a hardware slot */
1166 };
1167
1168 typedef uint32 CSSM_CSP_FLAGS;
1169 enum {
1170 CSSM_CSP_TOK_WRITE_PROTECTED = 0x00000002,
1171 CSSM_CSP_TOK_LOGIN_REQUIRED = 0x00000004,
1172 CSSM_CSP_TOK_USER_PIN_INITIALIZED = 0x00000008,
1173 CSSM_CSP_TOK_PROT_AUTHENTICATION = 0x00000100,
1174 CSSM_CSP_TOK_USER_PIN_EXPIRED = 0x00100000,
1175 CSSM_CSP_TOK_SESSION_KEY_PASSWORD = 0x00200000,
1176 CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD = 0x00400000,
1177 CSSM_CSP_STORES_PRIVATE_KEYS = 0x01000000,
1178 CSSM_CSP_STORES_PUBLIC_KEYS = 0x02000000,
1179 CSSM_CSP_STORES_SESSION_KEYS = 0x04000000,
1180 CSSM_CSP_STORES_CERTIFICATES = 0x08000000,
1181 CSSM_CSP_STORES_GENERIC = 0x10000000
1182 };
1183
1184 typedef uint32 CSSM_PKCS_OAEP_MGF;
1185 enum {
1186 CSSM_PKCS_OAEP_MGF_NONE = 0,
1187 CSSM_PKCS_OAEP_MGF1_SHA1 = CSSM_PKCS_OAEP_MGF_NONE + 1,
1188 CSSM_PKCS_OAEP_MGF1_MD5 = CSSM_PKCS_OAEP_MGF_NONE + 2
1189 };
1190
1191 typedef uint32 CSSM_PKCS_OAEP_PSOURCE;
1192 enum {
1193 CSSM_PKCS_OAEP_PSOURCE_NONE = 0,
1194 CSSM_PKCS_OAEP_PSOURCE_Pspecified = CSSM_PKCS_OAEP_PSOURCE_NONE + 1
1195 };
1196
1197 typedef struct cssm_pkcs1_oaep_params {
1198 uint32 HashAlgorithm;
1199 CSSM_DATA HashParams;
1200 CSSM_PKCS_OAEP_MGF MGF;
1201 CSSM_DATA MGFParams;
1202 CSSM_PKCS_OAEP_PSOURCE PSource;
1203 CSSM_DATA PSourceParams;
1204 } CSSM_PKCS1_OAEP_PARAMS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_PKCS1_OAEP_PARAMS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1205
1206 typedef struct cssm_csp_operational_statistics {
1207 CSSM_BOOL UserAuthenticated;
1208 /* CSSM_TRUE if the user is logged in to the token, CSSM_FALSE otherwise. */
1209 CSSM_CSP_FLAGS DeviceFlags;
1210 uint32 TokenMaxSessionCount; /* Exported by Cryptoki modules. */
1211 uint32 TokenOpenedSessionCount;
1212 uint32 TokenMaxRWSessionCount;
1213 uint32 TokenOpenedRWSessionCount;
1214 uint32 TokenTotalPublicMem; /* Storage space statistics. */
1215 uint32 TokenFreePublicMem;
1216 uint32 TokenTotalPrivateMem;
1217 uint32 TokenFreePrivateMem;
1218 } CSSM_CSP_OPERATIONAL_STATISTICS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CSP_OPERATIONAL_STATISTICS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1219
1220 /* Indicates that the statistical value can not be revealed or is not
1221 relevant for a CSP */
1222 enum {
1223 CSSM_VALUE_NOT_AVAILABLE = (uint32)(~0)
1224 };
1225
1226 typedef struct cssm_pkcs5_pbkdf1_params {
1227 CSSM_DATA Passphrase;
1228 CSSM_DATA InitVector;
1229 } CSSM_PKCS5_PBKDF1_PARAMS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_PKCS5_PBKDF1_PARAMS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1230
1231 typedef uint32 CSSM_PKCS5_PBKDF2_PRF;
1232 enum {
1233 CSSM_PKCS5_PBKDF2_PRF_HMAC_SHA1 = 0
1234 };
1235
1236 typedef struct cssm_pkcs5_pbkdf2_params {
1237 CSSM_DATA Passphrase;
1238 CSSM_PKCS5_PBKDF2_PRF PseudoRandomFunction;
1239 } CSSM_PKCS5_PBKDF2_PARAMS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_PKCS5_PBKDF2_PARAMS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1240
1241 typedef struct cssm_kea_derive_params {
1242 CSSM_DATA Rb;
1243 CSSM_DATA Yb;
1244 } CSSM_KEA_DERIVE_PARAMS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_KEA_DERIVE_PARAMS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1245
1246
1247 /* Data Types for Trust Policy Services */
1248
1249 typedef struct cssm_tp_authority_id {
1250 CSSM_DATA *AuthorityCert;
1251 CSSM_NET_ADDRESS_PTR AuthorityLocation;
1252 } CSSM_TP_AUTHORITY_ID DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_AUTHORITY_ID_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1253
1254 typedef uint32 CSSM_TP_AUTHORITY_REQUEST_TYPE, *CSSM_TP_AUTHORITY_REQUEST_TYPE_PTR;
1255 enum {
1256 CSSM_TP_AUTHORITY_REQUEST_CERTISSUE = 0x01,
1257 CSSM_TP_AUTHORITY_REQUEST_CERTREVOKE = 0x02,
1258 CSSM_TP_AUTHORITY_REQUEST_CERTSUSPEND = 0x03,
1259 CSSM_TP_AUTHORITY_REQUEST_CERTRESUME = 0x04,
1260 CSSM_TP_AUTHORITY_REQUEST_CERTVERIFY = 0x05,
1261 CSSM_TP_AUTHORITY_REQUEST_CERTNOTARIZE = 0x06,
1262 CSSM_TP_AUTHORITY_REQUEST_CERTUSERECOVER = 0x07,
1263 CSSM_TP_AUTHORITY_REQUEST_CRLISSUE = 0x100
1264 };
1265
1266 typedef CSSM_RETURN (CSSMAPI * CSSM_TP_VERIFICATION_RESULTS_CALLBACK)
1267 (CSSM_MODULE_HANDLE ModuleHandle,
1268 void *CallerCtx,
1269 CSSM_DATA_PTR VerifiedCert);
1270
1271 /* From CL */
1272 typedef CSSM_DATA CSSM_OID, *CSSM_OID_PTR;
1273
1274 typedef struct cssm_field {
1275 CSSM_OID FieldOid;
1276 CSSM_DATA FieldValue;
1277 } CSSM_FIELD DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_FIELD_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1278
1279 /* TP Again. */
1280 typedef struct cssm_tp_policyinfo {
1281 uint32 NumberOfPolicyIds;
1282 CSSM_FIELD_PTR PolicyIds;
1283 void *PolicyControl;
1284 } CSSM_TP_POLICYINFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_POLICYINFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1285
1286 typedef uint32 CSSM_TP_SERVICES;
1287 enum {
1288 /* bit masks for additional Authority services available through TP */
1289 CSSM_TP_KEY_ARCHIVE = 0x0001, /* archive cert & keys */
1290 CSSM_TP_CERT_PUBLISH = 0x0002, /* register cert in directory */
1291 CSSM_TP_CERT_NOTIFY_RENEW = 0x0004, /* notify at renewal time */
1292 CSSM_TP_CERT_DIR_UPDATE = 0x0008, /* update cert registry entry */
1293 CSSM_TP_CRL_DISTRIBUTE = 0x0010 /* push CRL to everyone */
1294 };
1295
1296 typedef uint32 CSSM_TP_ACTION;
1297 enum {
1298 CSSM_TP_ACTION_DEFAULT = 0
1299 };
1300
1301 typedef uint32 CSSM_TP_STOP_ON;
1302 enum {
1303 CSSM_TP_STOP_ON_POLICY = 0, /* use the pre-defined stopping criteria */
1304 CSSM_TP_STOP_ON_NONE = 1, /* evaluate all condition whether TRUE or FALSE */
1305 CSSM_TP_STOP_ON_FIRST_PASS = 2, /* stop evaluation at first TRUE */
1306 CSSM_TP_STOP_ON_FIRST_FAIL = 3 /* stop evaluation at first FALSE */
1307 };
1308
1309 typedef char *CSSM_TIMESTRING;
1310
1311 /* From DL. */
1312 typedef struct cssm_dl_db_list {
1313 uint32 NumHandles;
1314 CSSM_DL_DB_HANDLE_PTR DLDBHandle;
1315 } CSSM_DL_DB_LIST DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DL_DB_LIST_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1316
1317 /* TP Again. */
1318 typedef struct cssm_tp_callerauth_context {
1319 CSSM_TP_POLICYINFO Policy;
1320 CSSM_TIMESTRING VerifyTime;
1321 CSSM_TP_STOP_ON VerificationAbortOn;
1322 CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert;
1323 uint32 NumberOfAnchorCerts;
1324 CSSM_DATA_PTR AnchorCerts;
1325 CSSM_DL_DB_LIST_PTR DBList;
1326 CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials;
1327 } CSSM_TP_CALLERAUTH_CONTEXT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CALLERAUTH_CONTEXT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1328
1329 typedef uint32 CSSM_CRL_PARSE_FORMAT, * CSSM_CRL_PARSE_FORMAT_PTR;
1330 enum {
1331 CSSM_CRL_PARSE_FORMAT_NONE = 0x00,
1332 CSSM_CRL_PARSE_FORMAT_CUSTOM = 0x01,
1333 CSSM_CRL_PARSE_FORMAT_SEXPR = 0x02,
1334 CSSM_CRL_PARSE_FORMAT_COMPLEX = 0x03,
1335 CSSM_CRL_PARSE_FORMAT_OID_NAMED = 0x04,
1336 CSSM_CRL_PARSE_FORMAT_TUPLE = 0x05,
1337 CSSM_CRL_PARSE_FORMAT_MULTIPLE = 0x7FFE,
1338 CSSM_CRL_PARSE_FORMAT_LAST = 0x7FFF,
1339 /* Applications wishing to define their own custom parse
1340 format should create a uint32 value greater than the
1341 CSSM_CL_CUSTOM_CRL_PARSE_FORMAT */
1342 CSSM_CL_CUSTOM_CRL_PARSE_FORMAT = 0x8000
1343 };
1344
1345 /* From CL. */
1346 typedef uint32 CSSM_CRL_TYPE, *CSSM_CRL_TYPE_PTR;
1347 enum {
1348 CSSM_CRL_TYPE_UNKNOWN = 0x00,
1349 CSSM_CRL_TYPE_X_509v1 = 0x01,
1350 CSSM_CRL_TYPE_X_509v2 = 0x02,
1351 CSSM_CRL_TYPE_SPKI = 0x03,
1352 CSSM_CRL_TYPE_MULTIPLE = 0x7FFE
1353 };
1354
1355 typedef uint32 CSSM_CRL_ENCODING, *CSSM_CRL_ENCODING_PTR;
1356 enum {
1357 CSSM_CRL_ENCODING_UNKNOWN = 0x00,
1358 CSSM_CRL_ENCODING_CUSTOM = 0x01,
1359 CSSM_CRL_ENCODING_BER = 0x02,
1360 CSSM_CRL_ENCODING_DER = 0x03,
1361 CSSM_CRL_ENCODING_BLOOM = 0x04,
1362 CSSM_CRL_ENCODING_SEXPR = 0x05,
1363 CSSM_CRL_ENCODING_MULTIPLE = 0x7FFE
1364 };
1365
1366 typedef struct cssm_encoded_crl {
1367 CSSM_CRL_TYPE CrlType; /* type of CRL */
1368 CSSM_CRL_ENCODING CrlEncoding; /* encoding for this packed CRL */
1369 CSSM_DATA CrlBlob; /* packed CRL */
1370 } CSSM_ENCODED_CRL DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_ENCODED_CRL_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1371
1372 /* TP Again. */
1373 typedef struct cssm_parsed_crl {
1374 CSSM_CRL_TYPE CrlType; /* CRL type */
1375 CSSM_CRL_PARSE_FORMAT ParsedCrlFormat;
1376 /* struct of ParsedCrl */
1377 void *ParsedCrl; /* parsed CRL (to be typecast) */
1378 } CSSM_PARSED_CRL DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_PARSED_CRL_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1379
1380 typedef struct cssm_crl_pair {
1381 CSSM_ENCODED_CRL EncodedCrl; /* an encoded CRL blob */
1382 CSSM_PARSED_CRL ParsedCrl; /* equivalent parsed CRL */
1383 } CSSM_CRL_PAIR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CRL_PAIR_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1384
1385 typedef uint32 CSSM_CRLGROUP_TYPE, * CSSM_CRLGROUP_TYPE_PTR;
1386 enum {
1387 CSSM_CRLGROUP_DATA = 0x00,
1388 CSSM_CRLGROUP_ENCODED_CRL = 0x01,
1389 CSSM_CRLGROUP_PARSED_CRL = 0x02,
1390 CSSM_CRLGROUP_CRL_PAIR = 0x03
1391 };
1392
1393 typedef struct cssm_crlgroup {
1394 CSSM_CRL_TYPE CrlType;
1395 CSSM_CRL_ENCODING CrlEncoding;
1396 uint32 NumberOfCrls;
1397 union {
1398 CSSM_DATA_PTR CrlList; /* CRL blob */
1399 CSSM_ENCODED_CRL_PTR EncodedCrlList; /* CRL blob w/ separate type */
1400 CSSM_PARSED_CRL_PTR ParsedCrlList; /* bushy, parsed CRL */
1401 CSSM_CRL_PAIR_PTR PairCrlList;
1402 } GroupCrlList;
1403 CSSM_CRLGROUP_TYPE CrlGroupType;
1404 } CSSM_CRLGROUP, *CSSM_CRLGROUP_PTR;
1405
1406 typedef struct cssm_fieldgroup {
1407 int NumberOfFields; /* number of fields in the array */
1408 CSSM_FIELD_PTR Fields; /* array of fields */
1409 } CSSM_FIELDGROUP DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_FIELDGROUP_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1410
1411 typedef uint32 CSSM_EVIDENCE_FORM;
1412 enum {
1413 CSSM_EVIDENCE_FORM_UNSPECIFIC = 0x0,
1414 CSSM_EVIDENCE_FORM_CERT = 0x1,
1415 CSSM_EVIDENCE_FORM_CRL = 0x2,
1416 CSSM_EVIDENCE_FORM_CERT_ID = 0x3,
1417 CSSM_EVIDENCE_FORM_CRL_ID = 0x4,
1418 CSSM_EVIDENCE_FORM_VERIFIER_TIME = 0x5,
1419 CSSM_EVIDENCE_FORM_CRL_THISTIME = 0x6,
1420 CSSM_EVIDENCE_FORM_CRL_NEXTTIME = 0x7,
1421 CSSM_EVIDENCE_FORM_POLICYINFO = 0x8,
1422 CSSM_EVIDENCE_FORM_TUPLEGROUP = 0x9
1423 };
1424
1425 typedef struct cssm_evidence {
1426 CSSM_EVIDENCE_FORM EvidenceForm;
1427 void *Evidence; /* Evidence content */
1428 } CSSM_EVIDENCE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_EVIDENCE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1429
1430 typedef struct cssm_tp_verify_context {
1431 CSSM_TP_ACTION Action;
1432 CSSM_DATA ActionData;
1433 CSSM_CRLGROUP Crls;
1434 CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred;
1435 } CSSM_TP_VERIFY_CONTEXT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_VERIFY_CONTEXT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1436
1437 typedef struct cssm_tp_verify_context_result {
1438 uint32 NumberOfEvidences;
1439 CSSM_EVIDENCE_PTR Evidence;
1440 } CSSM_TP_VERIFY_CONTEXT_RESULT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_VERIFY_CONTEXT_RESULT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1441
1442 typedef struct cssm_tp_request_set {
1443 uint32 NumberOfRequests;
1444 void *Requests;
1445 } CSSM_TP_REQUEST_SET DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_REQUEST_SET_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1446
1447 typedef struct cssm_tp_result_set {
1448 uint32 NumberOfResults;
1449 void *Results;
1450 } CSSM_TP_RESULT_SET DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_RESULT_SET_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1451
1452 typedef uint32 CSSM_TP_CONFIRM_STATUS, *CSSM_TP_CONFIRM_STATUS_PTR;
1453 enum {
1454 CSSM_TP_CONFIRM_STATUS_UNKNOWN = 0x0,
1455 /* indeterminate */
1456 CSSM_TP_CONFIRM_ACCEPT = 0x1,
1457 /* accept results of executing a
1458 submit-retrieve function pair */
1459 CSSM_TP_CONFIRM_REJECT = 0x2
1460 /* reject results of executing a
1461 submit-retrieve function pair */
1462 };
1463
1464 typedef struct cssm_tp_confirm_response {
1465 uint32 NumberOfResponses;
1466 CSSM_TP_CONFIRM_STATUS_PTR Responses;
1467 } CSSM_TP_CONFIRM_RESPONSE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CONFIRM_RESPONSE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1468
1469 enum {
1470 CSSM_ESTIMATED_TIME_UNKNOWN = -1
1471 };
1472
1473 enum {
1474 CSSM_ELAPSED_TIME_UNKNOWN = -1,
1475 CSSM_ELAPSED_TIME_COMPLETE = -2
1476 };
1477
1478 typedef struct cssm_tp_certissue_input {
1479 CSSM_SUBSERVICE_UID CSPSubserviceUid;
1480 CSSM_CL_HANDLE CLHandle;
1481 uint32 NumberOfTemplateFields;
1482 CSSM_FIELD_PTR SubjectCertFields;
1483 CSSM_TP_SERVICES MoreServiceRequests;
1484 uint32 NumberOfServiceControls;
1485 CSSM_FIELD_PTR ServiceControls;
1486 CSSM_ACCESS_CREDENTIALS_PTR UserCredentials;
1487 } CSSM_TP_CERTISSUE_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTISSUE_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1488
1489 typedef uint32 CSSM_TP_CERTISSUE_STATUS;
1490 enum {
1491 CSSM_TP_CERTISSUE_STATUS_UNKNOWN = 0x0,
1492 /* indeterminate */
1493 CSSM_TP_CERTISSUE_OK = 0x1,
1494 /* cert issued as requested */
1495 CSSM_TP_CERTISSUE_OKWITHCERTMODS = 0x2,
1496 /* cert issued but cert contents were
1497 updated by the issuing authority */
1498 CSSM_TP_CERTISSUE_OKWITHSERVICEMODS = 0x3,
1499 /* cert issued but some requested backend
1500 services were not performed by the
1501 issuing authority */
1502 CSSM_TP_CERTISSUE_REJECTED = 0x4,
1503 /* cert was not issued due to some error
1504 condition */
1505 CSSM_TP_CERTISSUE_NOT_AUTHORIZED = 0x5,
1506 /* cert was not issued, the request was
1507 not authorized */
1508 CSSM_TP_CERTISSUE_WILL_BE_REVOKED = 0x6
1509 /* cert was issued, but TP has initiated
1510 a revocation of the certificate */
1511 };
1512
1513 typedef struct cssm_tp_certissue_output {
1514 CSSM_TP_CERTISSUE_STATUS IssueStatus;
1515 CSSM_CERTGROUP_PTR CertGroup;
1516 CSSM_TP_SERVICES PerformedServiceRequests;
1517 } CSSM_TP_CERTISSUE_OUTPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTISSUE_OUTPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1518
1519 typedef uint32 CSSM_TP_CERTCHANGE_ACTION;
1520 enum {
1521 CSSM_TP_CERTCHANGE_NONE = 0x0, /* no change */
1522 CSSM_TP_CERTCHANGE_REVOKE = 0x1, /* Revoke the certificate */
1523 /* This action type indicates a request to revoke a single
1524 certificate. Notice of the revocation operation remains
1525 in affect until the certificate itself expires. Revocation
1526 should be used to permanently remove a certificate from use. */
1527 CSSM_TP_CERTCHANGE_HOLD = 0x2, /* Hold/suspend the certificate */
1528 /* This action type indicates a request to suspend a
1529 single certificate. A suspension operation implies
1530 that the requester intends, at some time in the future,
1531 to request that the certificate be released from hold,
1532 making it available for use again. Placing a hold on
1533 a certificate does not obligate the requester to
1534 request a release. In practice, a certificate may
1535 remain on hold until the certificate itself expires.
1536 Revocation should be used to permanently remove a
1537 certificate from use. */
1538 CSSM_TP_CERTCHANGE_RELEASE = 0x3 /* Release the held certificate */
1539 /* This action type indicates a request to release a
1540 single certificate currently on hold. A release
1541 operation makes a certificate available for use again.
1542 Revocation should be used to permanently remove a
1543 certificate from use. */
1544 };
1545
1546 typedef uint32 CSSM_TP_CERTCHANGE_REASON;
1547 enum {
1548 CSSM_TP_CERTCHANGE_REASON_UNKNOWN = 0x0,
1549 /* unspecified */
1550 CSSM_TP_CERTCHANGE_REASON_KEYCOMPROMISE = 0x1,
1551 /* Subject key believed to be compromised */
1552 CSSM_TP_CERTCHANGE_REASON_CACOMPROMISE = 0x2,
1553 /* CA\92s key believed to be compromised */
1554 CSSM_TP_CERTCHANGE_REASON_CEASEOPERATION = 0x3,
1555 /* certificate holder ceases operation under
1556 the jurisdiction of this certificate */
1557 CSSM_TP_CERTCHANGE_REASON_AFFILIATIONCHANGE = 0x4,
1558 /* certificate holder has moved from this
1559 jurisdiction */
1560 CSSM_TP_CERTCHANGE_REASON_SUPERCEDED = 0x5,
1561 /* certificate holder as issued a new, superceding
1562 certificate */
1563 CSSM_TP_CERTCHANGE_REASON_SUSPECTEDCOMPROMISE = 0x6,
1564 /* certificate could be compromised */
1565 CSSM_TP_CERTCHANGE_REASON_HOLDRELEASE = 0x7
1566 /* certificate holder resumes operation under the
1567 jurisdiction of this certificate */
1568 };
1569
1570 typedef struct cssm_tp_certchange_input {
1571 CSSM_TP_CERTCHANGE_ACTION Action;
1572 CSSM_TP_CERTCHANGE_REASON Reason;
1573 CSSM_CL_HANDLE CLHandle;
1574 CSSM_DATA_PTR Cert;
1575 CSSM_FIELD_PTR ChangeInfo;
1576 CSSM_TIMESTRING StartTime;
1577 CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials;
1578 } CSSM_TP_CERTCHANGE_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTCHANGE_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1579
1580 typedef uint32 CSSM_TP_CERTCHANGE_STATUS;
1581 enum {
1582 CSSM_TP_CERTCHANGE_STATUS_UNKNOWN = 0x0,
1583 /* indeterminate */
1584 CSSM_TP_CERTCHANGE_OK = 0x1,
1585 /* cert state was successfully changed
1586 beginning at the specified time */
1587 CSSM_TP_CERTCHANGE_OKWITHNEWTIME = 0x2,
1588 /* cert state was successfully changed,
1589 at a modified effective time */
1590 CSSM_TP_CERTCHANGE_WRONGCA = 0x3,
1591 /* cert state was not changed, the
1592 selected CA is not authorized to
1593 change the cert state */
1594 CSSM_TP_CERTCHANGE_REJECTED = 0x4,
1595 /* cert state was not changed due to some
1596 error condition */
1597 CSSM_TP_CERTCHANGE_NOT_AUTHORIZED = 0x5
1598 /* cert state was not changed, the
1599 requester is not authorized to change
1600 the cert state */
1601 };
1602
1603 typedef struct cssm_tp_certchange_output {
1604 CSSM_TP_CERTCHANGE_STATUS ActionStatus;
1605 CSSM_FIELD RevokeInfo;
1606 } CSSM_TP_CERTCHANGE_OUTPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTCHANGE_OUTPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1607
1608 typedef struct cssm_tp_certverify_input {
1609 CSSM_CL_HANDLE CLHandle;
1610 CSSM_DATA_PTR Cert;
1611 CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext;
1612 } CSSM_TP_CERTVERIFY_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTVERIFY_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1613
1614 typedef uint32 CSSM_TP_CERTVERIFY_STATUS;
1615 enum {
1616 CSSM_TP_CERTVERIFY_UNKNOWN = 0x0,
1617 CSSM_TP_CERTVERIFY_VALID = 0x1,
1618 CSSM_TP_CERTVERIFY_INVALID = 0x2,
1619 CSSM_TP_CERTVERIFY_REVOKED = 0x3,
1620 CSSM_TP_CERTVERIFY_SUSPENDED = 0x4,
1621 CSSM_TP_CERTVERIFY_EXPIRED = 0x5,
1622 CSSM_TP_CERTVERIFY_NOT_VALID_YET = 0x6,
1623 CSSM_TP_CERTVERIFY_INVALID_AUTHORITY = 0x7,
1624 CSSM_TP_CERTVERIFY_INVALID_SIGNATURE = 0x8,
1625 CSSM_TP_CERTVERIFY_INVALID_CERT_VALUE = 0x9,
1626 CSSM_TP_CERTVERIFY_INVALID_CERTGROUP = 0xA,
1627 CSSM_TP_CERTVERIFY_INVALID_POLICY = 0xB,
1628 CSSM_TP_CERTVERIFY_INVALID_POLICY_IDS = 0xC,
1629 CSSM_TP_CERTVERIFY_INVALID_BASIC_CONSTRAINTS = 0xD,
1630 CSSM_TP_CERTVERIFY_INVALID_CRL_DIST_PT = 0xE,
1631 CSSM_TP_CERTVERIFY_INVALID_NAME_TREE = 0xF,
1632 CSSM_TP_CERTVERIFY_UNKNOWN_CRITICAL_EXT = 0x10
1633 };
1634
1635 typedef struct cssm_tp_certverify_output {
1636 CSSM_TP_CERTVERIFY_STATUS VerifyStatus;
1637 uint32 NumberOfEvidence;
1638 CSSM_EVIDENCE_PTR Evidence;
1639 } CSSM_TP_CERTVERIFY_OUTPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTVERIFY_OUTPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1640
1641 typedef struct cssm_tp_certnotarize_input {
1642 CSSM_CL_HANDLE CLHandle;
1643 uint32 NumberOfFields;
1644 CSSM_FIELD_PTR MoreFields;
1645 CSSM_FIELD_PTR SignScope;
1646 uint32 ScopeSize;
1647 CSSM_TP_SERVICES MoreServiceRequests;
1648 uint32 NumberOfServiceControls;
1649 CSSM_FIELD_PTR ServiceControls;
1650 CSSM_ACCESS_CREDENTIALS_PTR UserCredentials;
1651 } CSSM_TP_CERTNOTARIZE_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTNOTARIZE_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1652
1653 typedef uint32 CSSM_TP_CERTNOTARIZE_STATUS;
1654 enum {
1655 CSSM_TP_CERTNOTARIZE_STATUS_UNKNOWN = 0x0,
1656 /* indeterminate */
1657 CSSM_TP_CERTNOTARIZE_OK = 0x1,
1658 /* cert fields were added and the result was
1659 notarized as requested */
1660 CSSM_TP_CERTNOTARIZE_OKWITHOUTFIELDS = 0x2,
1661 /* non-conflicting cert fields were added,
1662 conflicting cert fields were ignored,
1663 and the result was notarized as requested */
1664 CSSM_TP_CERTNOTARIZE_OKWITHSERVICEMODS = 0x3,
1665 /* cert fields were added and the result was
1666 notarized as requested, but some requested
1667 backend services were not performed by the
1668 notary */
1669 CSSM_TP_CERTNOTARIZE_REJECTED = 0x4,
1670 /* cert was not notarized due to some error
1671 condition */
1672 CSSM_TP_CERTNOTARIZE_NOT_AUTHORIZED = 0x5
1673 /* cert was not notarized, the request was
1674 not authorized */
1675 };
1676
1677 typedef struct cssm_tp_certnotarize_output {
1678 CSSM_TP_CERTNOTARIZE_STATUS NotarizeStatus;
1679 CSSM_CERTGROUP_PTR NotarizedCertGroup;
1680 CSSM_TP_SERVICES PerformedServiceRequests;
1681 } CSSM_TP_CERTNOTARIZE_OUTPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTNOTARIZE_OUTPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1682
1683 typedef struct cssm_tp_certreclaim_input {
1684 CSSM_CL_HANDLE CLHandle;
1685 uint32 NumberOfSelectionFields;
1686 CSSM_FIELD_PTR SelectionFields;
1687 CSSM_ACCESS_CREDENTIALS_PTR UserCredentials;
1688 } CSSM_TP_CERTRECLAIM_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTRECLAIM_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1689
1690 typedef uint32 CSSM_TP_CERTRECLAIM_STATUS;
1691 enum {
1692 CSSM_TP_CERTRECLAIM_STATUS_UNKNOWN = 0x0,
1693 /* indeterminate */
1694 CSSM_TP_CERTRECLAIM_OK = 0x1,
1695 /* a set of one or more certificates were
1696 returned by the CA for local recovery
1697 of the associated private key */
1698 CSSM_TP_CERTRECLAIM_NOMATCH = 0x2,
1699 /* no certificates owned by the requester
1700 were found matching the specified
1701 selection fields */
1702 CSSM_TP_CERTRECLAIM_REJECTED = 0x3,
1703 /* certificate reclamation failed due
1704 to some error condition */
1705 CSSM_TP_CERTRECLAIM_NOT_AUTHORIZED = 0x4
1706 /* certificate reclamation was not
1707 performed, the request was not
1708 authorized */
1709 };
1710
1711 typedef struct cssm_tp_certreclaim_output {
1712 CSSM_TP_CERTRECLAIM_STATUS ReclaimStatus;
1713 CSSM_CERTGROUP_PTR ReclaimedCertGroup;
1714 CSSM_LONG_HANDLE KeyCacheHandle;
1715 } CSSM_TP_CERTRECLAIM_OUTPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CERTRECLAIM_OUTPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1716
1717 typedef struct cssm_tp_crlissue_input {
1718 CSSM_CL_HANDLE CLHandle;
1719 uint32 CrlIdentifier;
1720 CSSM_TIMESTRING CrlThisTime;
1721 CSSM_FIELD_PTR PolicyIdentifier;
1722 CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials;
1723 } CSSM_TP_CRLISSUE_INPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CRLISSUE_INPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1724
1725 typedef uint32 CSSM_TP_CRLISSUE_STATUS;
1726 enum {
1727 CSSM_TP_CRLISSUE_STATUS_UNKNOWN = 0x0,
1728 /* indeterminate */
1729 CSSM_TP_CRLISSUE_OK = 0x1,
1730 /* a copy of the most current CRL was
1731 issued as requested and the time for
1732 issuing the next CRL is also returned */
1733 CSSM_TP_CRLISSUE_NOT_CURRENT = 0x2,
1734 /* either no CRL has been issued since
1735 the CRL identified in the request, or
1736 it is not time to issue an updated CRL.
1737 no CRL has been returned, but the time
1738 for issuing the next CRL is included
1739 in the results */
1740 CSSM_TP_CRLISSUE_INVALID_DOMAIN = 0x3,
1741 /* CRL domain was not recognized or was
1742 outside the CA jurisdiction, no CRL or
1743 time for the next CRL has been
1744 returned. */
1745 CSSM_TP_CRLISSUE_UNKNOWN_IDENTIFIER = 0x4,
1746 /* unrecognized CRL identifier, no CRL or
1747 time for the next CRL has been
1748 returned. */
1749 CSSM_TP_CRLISSUE_REJECTED = 0x5,
1750 /* CRL was not issued due to some error
1751 condition, no CRL or time for the next
1752 CRL has been returned. */
1753 CSSM_TP_CRLISSUE_NOT_AUTHORIZED = 0x6
1754 /* CRL was not issued, the request was
1755 not authorized, no CRL or time for the
1756 next CRL has been returned. */
1757 };
1758
1759 typedef struct cssm_tp_crlissue_output {
1760 CSSM_TP_CRLISSUE_STATUS IssueStatus;
1761 CSSM_ENCODED_CRL_PTR Crl;
1762 CSSM_TIMESTRING CrlNextTime;
1763 } CSSM_TP_CRLISSUE_OUTPUT DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_TP_CRLISSUE_OUTPUT_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1764
1765 typedef uint32 CSSM_TP_FORM_TYPE;
1766 enum {
1767 CSSM_TP_FORM_TYPE_GENERIC = 0x0,
1768 CSSM_TP_FORM_TYPE_REGISTRATION = 0x1
1769 };
1770
1771 /* Data Types for Certificate Library Services */
1772
1773 typedef uint32 CSSM_CL_TEMPLATE_TYPE;
1774 enum {
1775 CSSM_CL_TEMPLATE_INTERMEDIATE_CERT = 1,
1776 /* for X509 certificates, a fully-formed
1777 encoded certificate with empty signature field */
1778 CSSM_CL_TEMPLATE_PKIX_CERTTEMPLATE = 2
1779 /* as defined in RFC2511, section 5 CertTemplate */
1780 };
1781
1782 typedef uint32 CSSM_CERT_BUNDLE_TYPE;
1783 enum {
1784 CSSM_CERT_BUNDLE_UNKNOWN = 0x00,
1785 CSSM_CERT_BUNDLE_CUSTOM = 0x01,
1786 CSSM_CERT_BUNDLE_PKCS7_SIGNED_DATA = 0x02,
1787 CSSM_CERT_BUNDLE_PKCS7_SIGNED_ENVELOPED_DATA = 0x03,
1788 CSSM_CERT_BUNDLE_PKCS12 = 0x04,
1789 CSSM_CERT_BUNDLE_PFX = 0x05,
1790 CSSM_CERT_BUNDLE_SPKI_SEQUENCE = 0x06,
1791 CSSM_CERT_BUNDLE_PGP_KEYRING = 0x07,
1792 CSSM_CERT_BUNDLE_LAST = 0x7FFF,
1793 /* Applications wishing to define their own custom certificate
1794 bundle type should define and publicly document a uint32
1795 value greater than CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE */
1796 CSSM_CL_CUSTOM_CERT_BUNDLE_TYPE = 0x8000
1797 };
1798
1799 typedef uint32 CSSM_CERT_BUNDLE_ENCODING;
1800 enum {
1801 CSSM_CERT_BUNDLE_ENCODING_UNKNOWN = 0x00,
1802 CSSM_CERT_BUNDLE_ENCODING_CUSTOM = 0x01,
1803 CSSM_CERT_BUNDLE_ENCODING_BER = 0x02,
1804 CSSM_CERT_BUNDLE_ENCODING_DER = 0x03,
1805 CSSM_CERT_BUNDLE_ENCODING_SEXPR = 0x04,
1806 CSSM_CERT_BUNDLE_ENCODING_PGP = 0x05
1807 };
1808
1809 typedef struct cssm_cert_bundle_header {
1810 CSSM_CERT_BUNDLE_TYPE BundleType;
1811 CSSM_CERT_BUNDLE_ENCODING BundleEncoding;
1812 } CSSM_CERT_BUNDLE_HEADER DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CERT_BUNDLE_HEADER_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1813
1814 typedef struct cssm_cert_bundle {
1815 CSSM_CERT_BUNDLE_HEADER BundleHeader;
1816 CSSM_DATA Bundle;
1817 } CSSM_CERT_BUNDLE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_CERT_BUNDLE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1818
1819 enum {
1820 CSSM_FIELDVALUE_COMPLEX_DATA_TYPE = 0xFFFFFFFF
1821 };
1822
1823 /* Data Types for Data Storage Library Services */
1824
1825 typedef uint32 CSSM_DB_ATTRIBUTE_NAME_FORMAT, *CSSM_DB_ATTRIBUTE_NAME_FORMAT_PTR;
1826 enum {
1827 CSSM_DB_ATTRIBUTE_NAME_AS_STRING = 0,
1828 CSSM_DB_ATTRIBUTE_NAME_AS_OID = 1,
1829 CSSM_DB_ATTRIBUTE_NAME_AS_INTEGER = 2
1830 };
1831
1832 typedef uint32 CSSM_DB_ATTRIBUTE_FORMAT, *CSSM_DB_ATTRIBUTE_FORMAT_PTR;
1833 enum {
1834 CSSM_DB_ATTRIBUTE_FORMAT_STRING = 0,
1835 CSSM_DB_ATTRIBUTE_FORMAT_SINT32 = 1,
1836 CSSM_DB_ATTRIBUTE_FORMAT_UINT32 = 2,
1837 CSSM_DB_ATTRIBUTE_FORMAT_BIG_NUM = 3,
1838 CSSM_DB_ATTRIBUTE_FORMAT_REAL = 4,
1839 CSSM_DB_ATTRIBUTE_FORMAT_TIME_DATE = 5,
1840 CSSM_DB_ATTRIBUTE_FORMAT_BLOB = 6,
1841 CSSM_DB_ATTRIBUTE_FORMAT_MULTI_UINT32 = 7,
1842 CSSM_DB_ATTRIBUTE_FORMAT_COMPLEX = 8
1843 };
1844
1845 typedef struct cssm_db_attribute_info {
1846 CSSM_DB_ATTRIBUTE_NAME_FORMAT AttributeNameFormat;
1847 union cssm_db_attribute_label {
1848 char *AttributeName; /* e.g., "record label" */
1849 CSSM_OID AttributeOID; /* e.g., CSSMOID_RECORDLABEL */
1850 uint32 AttributeID; /* e.g., FOUR_CHAR_CODE('recl') */
1851 } Label;
1852 CSSM_DB_ATTRIBUTE_FORMAT AttributeFormat;
1853 } CSSM_DB_ATTRIBUTE_INFO, *CSSM_DB_ATTRIBUTE_INFO_PTR;
1854
1855 typedef struct cssm_db_attribute_data {
1856 CSSM_DB_ATTRIBUTE_INFO Info;
1857 uint32 NumberOfValues;
1858 CSSM_DATA_PTR Value;
1859 } CSSM_DB_ATTRIBUTE_DATA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_ATTRIBUTE_DATA_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1860
1861 typedef uint32 CSSM_DB_RECORDTYPE;
1862 enum {
1863 /* Schema Management Name Space Range Definition*/
1864 CSSM_DB_RECORDTYPE_SCHEMA_START = 0x00000000,
1865 CSSM_DB_RECORDTYPE_SCHEMA_END = CSSM_DB_RECORDTYPE_SCHEMA_START + 4,
1866 /* Open Group Application Name Space Range Definition*/
1867 CSSM_DB_RECORDTYPE_OPEN_GROUP_START = 0x0000000A,
1868 CSSM_DB_RECORDTYPE_OPEN_GROUP_END = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 8,
1869 /* Industry At Large Application Name Space Range Definition */
1870 CSSM_DB_RECORDTYPE_APP_DEFINED_START = 0x80000000,
1871 CSSM_DB_RECORDTYPE_APP_DEFINED_END = 0xffffffff,
1872 /* Record Types defined in the Schema Management Name Space */
1873 CSSM_DL_DB_SCHEMA_INFO = CSSM_DB_RECORDTYPE_SCHEMA_START + 0,
1874 CSSM_DL_DB_SCHEMA_INDEXES = CSSM_DB_RECORDTYPE_SCHEMA_START + 1,
1875 CSSM_DL_DB_SCHEMA_ATTRIBUTES = CSSM_DB_RECORDTYPE_SCHEMA_START + 2,
1876 CSSM_DL_DB_SCHEMA_PARSING_MODULE = CSSM_DB_RECORDTYPE_SCHEMA_START + 3,
1877 /* Record Types defined in the Open Group Application Name Space */
1878 CSSM_DL_DB_RECORD_ANY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 0,
1879 CSSM_DL_DB_RECORD_CERT = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 1,
1880 CSSM_DL_DB_RECORD_CRL = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 2,
1881 CSSM_DL_DB_RECORD_POLICY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 3,
1882 CSSM_DL_DB_RECORD_GENERIC = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 4,
1883 CSSM_DL_DB_RECORD_PUBLIC_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 5,
1884 CSSM_DL_DB_RECORD_PRIVATE_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 6,
1885 CSSM_DL_DB_RECORD_SYMMETRIC_KEY = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 7,
1886 CSSM_DL_DB_RECORD_ALL_KEYS = CSSM_DB_RECORDTYPE_OPEN_GROUP_START + 8
1887 };
1888
1889 enum {
1890 CSSM_DB_CERT_USE_TRUSTED = 0x00000001, /* application-defined as trusted */
1891 CSSM_DB_CERT_USE_SYSTEM = 0x00000002, /* the CSSM system cert */
1892 CSSM_DB_CERT_USE_OWNER = 0x00000004, /* private key owned by system user*/
1893 CSSM_DB_CERT_USE_REVOKED = 0x00000008, /* revoked cert -15913 used w CRL APIs */
1894 CSSM_DB_CERT_USE_SIGNING = 0x00000010, /* use cert for signing only */
1895 CSSM_DB_CERT_USE_PRIVACY = 0x00000020 /* use cert for confidentiality only */
1896 };
1897
1898 typedef struct cssm_db_record_attribute_info {
1899 CSSM_DB_RECORDTYPE DataRecordType;
1900 uint32 NumberOfAttributes;
1901 CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo;
1902 } CSSM_DB_RECORD_ATTRIBUTE_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1903
1904 typedef struct cssm_db_record_attribute_data {
1905 CSSM_DB_RECORDTYPE DataRecordType;
1906 uint32 SemanticInformation;
1907 uint32 NumberOfAttributes;
1908 CSSM_DB_ATTRIBUTE_DATA_PTR AttributeData;
1909 } CSSM_DB_RECORD_ATTRIBUTE_DATA DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_RECORD_ATTRIBUTE_DATA_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1910
1911 typedef struct cssm_db_parsing_module_info {
1912 CSSM_DB_RECORDTYPE RecordType;
1913 CSSM_SUBSERVICE_UID ModuleSubserviceUid;
1914 } CSSM_DB_PARSING_MODULE_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_PARSING_MODULE_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1915
1916 typedef uint32 CSSM_DB_INDEX_TYPE;
1917 enum {
1918 CSSM_DB_INDEX_UNIQUE = 0,
1919 CSSM_DB_INDEX_NONUNIQUE = 1
1920 };
1921
1922 typedef uint32 CSSM_DB_INDEXED_DATA_LOCATION;
1923 enum {
1924 CSSM_DB_INDEX_ON_UNKNOWN = 0,
1925 CSSM_DB_INDEX_ON_ATTRIBUTE = 1,
1926 CSSM_DB_INDEX_ON_RECORD = 2
1927 };
1928
1929 typedef struct cssm_db_index_info {
1930 CSSM_DB_INDEX_TYPE IndexType;
1931 CSSM_DB_INDEXED_DATA_LOCATION IndexedDataLocation;
1932 CSSM_DB_ATTRIBUTE_INFO Info;
1933 } CSSM_DB_INDEX_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_INDEX_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1934
1935 typedef struct cssm_db_unique_record {
1936 CSSM_DB_INDEX_INFO RecordLocator;
1937 CSSM_DATA RecordIdentifier;
1938 } CSSM_DB_UNIQUE_RECORD DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_UNIQUE_RECORD_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1939
1940 typedef struct cssm_db_record_index_info {
1941 CSSM_DB_RECORDTYPE DataRecordType;
1942 uint32 NumberOfIndexes;
1943 CSSM_DB_INDEX_INFO_PTR IndexInfo;
1944 } CSSM_DB_RECORD_INDEX_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_RECORD_INDEX_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1945
1946 typedef uint32 CSSM_DB_ACCESS_TYPE, *CSSM_DB_ACCESS_TYPE_PTR;
1947 enum {
1948 CSSM_DB_ACCESS_READ = 0x00001,
1949 CSSM_DB_ACCESS_WRITE = 0x00002,
1950 CSSM_DB_ACCESS_PRIVILEGED = 0x00004 /* versus user mode */
1951 };
1952
1953 typedef uint32 CSSM_DB_MODIFY_MODE;
1954 enum {
1955 CSSM_DB_MODIFY_ATTRIBUTE_NONE = 0,
1956 CSSM_DB_MODIFY_ATTRIBUTE_ADD = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 1,
1957 CSSM_DB_MODIFY_ATTRIBUTE_DELETE = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 2,
1958 CSSM_DB_MODIFY_ATTRIBUTE_REPLACE = CSSM_DB_MODIFY_ATTRIBUTE_NONE + 3
1959 };
1960
1961 typedef struct cssm_dbinfo {
1962 /* meta information about each record type stored in this
1963 data store including meta information about record
1964 attributes and indexes */
1965 uint32 NumberOfRecordTypes;
1966 CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules;
1967 CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames;
1968 CSSM_DB_RECORD_INDEX_INFO_PTR RecordIndexes;
1969 /* access restrictions for opening this data store */
1970 CSSM_BOOL IsLocal;
1971 char *AccessPath; /* URL, dir path, etc. */
1972 void *Reserved;
1973 } CSSM_DBINFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DBINFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1974
1975 typedef uint32 CSSM_DB_OPERATOR, *CSSM_DB_OPERATOR_PTR;
1976 enum {
1977 CSSM_DB_EQUAL = 0,
1978 CSSM_DB_NOT_EQUAL = 1,
1979 CSSM_DB_LESS_THAN = 2,
1980 CSSM_DB_GREATER_THAN = 3,
1981 CSSM_DB_CONTAINS = 4,
1982 CSSM_DB_CONTAINS_INITIAL_SUBSTRING = 5,
1983 CSSM_DB_CONTAINS_FINAL_SUBSTRING = 6
1984 };
1985
1986 typedef uint32 CSSM_DB_CONJUNCTIVE, *CSSM_DB_CONJUNCTIVE_PTR;
1987 enum {
1988 CSSM_DB_NONE = 0,
1989 CSSM_DB_AND = 1,
1990 CSSM_DB_OR = 2
1991 };
1992
1993 typedef struct cssm_selection_predicate {
1994 CSSM_DB_OPERATOR DbOperator;
1995 CSSM_DB_ATTRIBUTE_DATA Attribute;
1996 } CSSM_SELECTION_PREDICATE DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_SELECTION_PREDICATE_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
1997
1998 enum {
1999 CSSM_QUERY_TIMELIMIT_NONE = 0
2000 };
2001
2002 enum {
2003 CSSM_QUERY_SIZELIMIT_NONE = 0
2004 };
2005
2006 typedef struct cssm_query_limits {
2007 uint32 TimeLimit; /* in seconds */
2008 uint32 SizeLimit; /* max. number of records to return */
2009 } CSSM_QUERY_LIMITS DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_QUERY_LIMITS_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
2010
2011 typedef uint32 CSSM_QUERY_FLAGS;
2012 enum {
2013 CSSM_QUERY_RETURN_DATA = 0x01
2014 };
2015
2016 typedef struct cssm_query {
2017 CSSM_DB_RECORDTYPE RecordType;
2018 CSSM_DB_CONJUNCTIVE Conjunctive;
2019 uint32 NumSelectionPredicates;
2020 CSSM_SELECTION_PREDICATE_PTR SelectionPredicate;
2021 CSSM_QUERY_LIMITS QueryLimits;
2022 CSSM_QUERY_FLAGS QueryFlags;
2023 } CSSM_QUERY DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_QUERY_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
2024
2025 typedef uint32 CSSM_DLTYPE, *CSSM_DLTYPE_PTR;
2026 enum {
2027 CSSM_DL_UNKNOWN = 0,
2028 CSSM_DL_CUSTOM = 1,
2029 CSSM_DL_LDAP = 2,
2030 CSSM_DL_ODBC = 3,
2031 CSSM_DL_PKCS11 = 4,
2032 CSSM_DL_FFS = 5, /* flat file system */
2033 CSSM_DL_MEMORY = 6,
2034 CSSM_DL_REMOTEDIR = 7
2035 };
2036
2037 typedef void *CSSM_DL_CUSTOM_ATTRIBUTES;
2038 typedef void *CSSM_DL_LDAP_ATTRIBUTES;
2039 typedef void *CSSM_DL_ODBC_ATTRIBUTES;
2040 typedef void *CSSM_DL_FFS_ATTRIBUTES;
2041
2042 typedef struct cssm_dl_pkcs11_attributes {
2043 uint32 DeviceAccessFlags;
2044 } *CSSM_DL_PKCS11_ATTRIBUTE, *CSSM_DL_PKCS11_ATTRIBUTE_PTR;
2045
2046 enum {
2047 CSSM_DB_DATASTORES_UNKNOWN = 0xFFFFFFFF
2048 };
2049
2050 typedef struct cssm_name_list {
2051 uint32 NumStrings;
2052 char **String;
2053 } CSSM_NAME_LIST DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_NAME_LIST_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
2054
2055 typedef uint32 CSSM_DB_RETRIEVAL_MODES;
2056 enum {
2057 CSSM_DB_TRANSACTIONAL_MODE = 0,
2058 CSSM_DB_FILESYSTEMSCAN_MODE = 1
2059 };
2060
2061 typedef struct cssm_db_schema_attribute_info {
2062 uint32 AttributeId;
2063 char *AttributeName;
2064 CSSM_OID AttributeNameID;
2065 CSSM_DB_ATTRIBUTE_FORMAT DataType;
2066 } CSSM_DB_SCHEMA_ATTRIBUTE_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_SCHEMA_ATTRIBUTE_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
2067
2068 typedef struct cssm_db_schema_index_info {
2069 uint32 AttributeId;
2070 uint32 IndexId;
2071 CSSM_DB_INDEX_TYPE IndexType;
2072 CSSM_DB_INDEXED_DATA_LOCATION IndexedDataLocation;
2073 } CSSM_DB_SCHEMA_INDEX_INFO DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER, *CSSM_DB_SCHEMA_INDEX_INFO_PTR DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
2074
2075 #ifdef __cplusplus
2076 }
2077 #endif
2078
2079 #endif /* _CSSMTYPE_H_ */