PageRenderTime 50ms CodeModel.GetById 33ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/packages/univint/src/cssmtype.pas

https://github.com/slibre/freepascal
Pascal | 2640 lines | 1937 code | 232 blank | 471 comment | 0 complexity | 4c5d8aa7734f8921e2e28c076783c682 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0

Large files files are truncated, but you can click here to view the full file

   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{  Pascal Translation Updated:  Jonas Maebe, <jonas@freepascal.org>, September 2010 }
  26{  Pascal Translation Update: Jonas Maebe <jonas@freepascal.org>, October 2012 }
  27{
  28    Modified for use with Free Pascal
  29    Version 308
  30    Please report any bugs to <gpc@microbizz.nl>
  31}
  32
  33{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  34{$mode macpas}
  35{$packenum 1}
  36{$macro on}
  37{$inline on}
  38{$calling mwpascal}
  39
  40unit cssmtype;
  41interface
  42{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  43{$setc GAP_INTERFACES_VERSION := $0308}
  44
  45{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  46    {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  47{$endc}
  48
  49{$ifc defined CPUPOWERPC and defined CPUI386}
  50	{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  51{$endc}
  52{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  53	{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  54{$endc}
  55
  56{$ifc not defined __ppc__ and defined CPUPOWERPC32}
  57	{$setc __ppc__ := 1}
  58{$elsec}
  59	{$setc __ppc__ := 0}
  60{$endc}
  61{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  62	{$setc __ppc64__ := 1}
  63{$elsec}
  64	{$setc __ppc64__ := 0}
  65{$endc}
  66{$ifc not defined __i386__ and defined CPUI386}
  67	{$setc __i386__ := 1}
  68{$elsec}
  69	{$setc __i386__ := 0}
  70{$endc}
  71{$ifc not defined __x86_64__ and defined CPUX86_64}
  72	{$setc __x86_64__ := 1}
  73{$elsec}
  74	{$setc __x86_64__ := 0}
  75{$endc}
  76{$ifc not defined __arm__ and defined CPUARM}
  77	{$setc __arm__ := 1}
  78{$elsec}
  79	{$setc __arm__ := 0}
  80{$endc}
  81
  82{$ifc defined cpu64}
  83  {$setc __LP64__ := 1}
  84{$elsec}
  85  {$setc __LP64__ := 0}
  86{$endc}
  87
  88
  89{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  90	{$error Conflicting definitions for __ppc__ and __i386__}
  91{$endc}
  92
  93{$ifc defined __ppc__ and __ppc__}
  94	{$setc TARGET_CPU_PPC := TRUE}
  95	{$setc TARGET_CPU_PPC64 := FALSE}
  96	{$setc TARGET_CPU_X86 := FALSE}
  97	{$setc TARGET_CPU_X86_64 := FALSE}
  98	{$setc TARGET_CPU_ARM := FALSE}
  99	{$setc TARGET_OS_MAC := TRUE}
 100	{$setc TARGET_OS_IPHONE := FALSE}
 101	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 102	{$setc TARGET_OS_EMBEDDED := FALSE}
 103{$elifc defined __ppc64__ and __ppc64__}
 104	{$setc TARGET_CPU_PPC := FALSE}
 105	{$setc TARGET_CPU_PPC64 := TRUE}
 106	{$setc TARGET_CPU_X86 := FALSE}
 107	{$setc TARGET_CPU_X86_64 := FALSE}
 108	{$setc TARGET_CPU_ARM := FALSE}
 109	{$setc TARGET_OS_MAC := TRUE}
 110	{$setc TARGET_OS_IPHONE := FALSE}
 111	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 112	{$setc TARGET_OS_EMBEDDED := FALSE}
 113{$elifc defined __i386__ and __i386__}
 114	{$setc TARGET_CPU_PPC := FALSE}
 115	{$setc TARGET_CPU_PPC64 := FALSE}
 116	{$setc TARGET_CPU_X86 := TRUE}
 117	{$setc TARGET_CPU_X86_64 := FALSE}
 118	{$setc TARGET_CPU_ARM := FALSE}
 119{$ifc defined(iphonesim)}
 120 	{$setc TARGET_OS_MAC := FALSE}
 121	{$setc TARGET_OS_IPHONE := TRUE}
 122	{$setc TARGET_IPHONE_SIMULATOR := TRUE}
 123{$elsec}
 124	{$setc TARGET_OS_MAC := TRUE}
 125	{$setc TARGET_OS_IPHONE := FALSE}
 126	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 127{$endc}
 128	{$setc TARGET_OS_EMBEDDED := FALSE}
 129{$elifc defined __x86_64__ and __x86_64__}
 130	{$setc TARGET_CPU_PPC := FALSE}
 131	{$setc TARGET_CPU_PPC64 := FALSE}
 132	{$setc TARGET_CPU_X86 := FALSE}
 133	{$setc TARGET_CPU_X86_64 := TRUE}
 134	{$setc TARGET_CPU_ARM := FALSE}
 135	{$setc TARGET_OS_MAC := TRUE}
 136	{$setc TARGET_OS_IPHONE := FALSE}
 137	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 138	{$setc TARGET_OS_EMBEDDED := FALSE}
 139{$elifc defined __arm__ and __arm__}
 140	{$setc TARGET_CPU_PPC := FALSE}
 141	{$setc TARGET_CPU_PPC64 := FALSE}
 142	{$setc TARGET_CPU_X86 := FALSE}
 143	{$setc TARGET_CPU_X86_64 := FALSE}
 144	{$setc TARGET_CPU_ARM := TRUE}
 145	{ will require compiler define when/if other Apple devices with ARM cpus ship }
 146	{$setc TARGET_OS_MAC := FALSE}
 147	{$setc TARGET_OS_IPHONE := TRUE}
 148	{$setc TARGET_IPHONE_SIMULATOR := FALSE}
 149	{$setc TARGET_OS_EMBEDDED := TRUE}
 150{$elsec}
 151	{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
 152{$endc}
 153
 154{$ifc defined __LP64__ and __LP64__ }
 155  {$setc TARGET_CPU_64 := TRUE}
 156{$elsec}
 157  {$setc TARGET_CPU_64 := FALSE}
 158{$endc}
 159
 160{$ifc defined FPC_BIG_ENDIAN}
 161	{$setc TARGET_RT_BIG_ENDIAN := TRUE}
 162	{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
 163{$elifc defined FPC_LITTLE_ENDIAN}
 164	{$setc TARGET_RT_BIG_ENDIAN := FALSE}
 165	{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
 166{$elsec}
 167	{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
 168{$endc}
 169{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
 170{$setc CALL_NOT_IN_CARBON := FALSE}
 171{$setc OLDROUTINENAMES := FALSE}
 172{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
 173{$setc OPAQUE_UPP_TYPES := TRUE}
 174{$setc OTCARBONAPPLICATION := TRUE}
 175{$setc OTKERNEL := FALSE}
 176{$setc PM_USE_SESSION_APIS := TRUE}
 177{$setc TARGET_API_MAC_CARBON := TRUE}
 178{$setc TARGET_API_MAC_OS8 := FALSE}
 179{$setc TARGET_API_MAC_OSX := TRUE}
 180{$setc TARGET_CARBON := TRUE}
 181{$setc TARGET_CPU_68K := FALSE}
 182{$setc TARGET_CPU_MIPS := FALSE}
 183{$setc TARGET_CPU_SPARC := FALSE}
 184{$setc TARGET_OS_UNIX := FALSE}
 185{$setc TARGET_OS_WIN32 := FALSE}
 186{$setc TARGET_RT_MAC_68881 := FALSE}
 187{$setc TARGET_RT_MAC_CFM := FALSE}
 188{$setc TARGET_RT_MAC_MACHO := TRUE}
 189{$setc TYPED_FUNCTION_POINTERS := TRUE}
 190{$setc TYPE_BOOL := FALSE}
 191{$setc TYPE_EXTENDED := FALSE}
 192{$setc TYPE_LONGLONG := TRUE}
 193uses MacTypes,cssmconfig;
 194{$endc} {not MACOSALLINCLUDE}
 195
 196
 197{$ifc TARGET_OS_MAC}
 198
 199{$packrecords c}
 200
 201{ Handle types. }
 202	
 203type
 204	CSSM_HANDLE = CSSM_INTPTR;
 205	CSSM_HANDLE_PTR = ^CSSM_INTPTR;
 206	CSSM_HANDLEPtr = ^CSSM_INTPTR;
 207
 208type
 209	CSSM_LONG_HANDLE = UInt64;
 210	CSSM_LONG_HANDLE_PTR = ^UInt64;
 211	CSSM_LONG_HANDLEPtr = ^UInt64;
 212
 213type
 214	CSSM_MODULE_HANDLE = CSSM_HANDLE;
 215	CSSM_MODULE_HANDLE_PTR = ^CSSM_HANDLE;
 216	CSSM_MODULE_HANDLEPtr = ^CSSM_HANDLE;
 217
 218type
 219	CSSM_CC_HANDLE = CSSM_LONG_HANDLE; { Cryptographic Context Handle }
 220
 221type
 222	CSSM_CSP_HANDLE = CSSM_MODULE_HANDLE; { Cryptographic Service Provider Handle }
 223
 224type
 225	CSSM_TP_HANDLE = CSSM_MODULE_HANDLE; { Trust Policy Handle }
 226
 227type
 228	CSSM_AC_HANDLE = CSSM_MODULE_HANDLE; { Authorization Computation Handle }
 229
 230type
 231	CSSM_CL_HANDLE = CSSM_MODULE_HANDLE; { Certificate Library Handle }
 232
 233type
 234	CSSM_DL_HANDLE = CSSM_MODULE_HANDLE; { Data Storage Library Handle }
 235
 236type
 237	CSSM_DB_HANDLE = CSSM_MODULE_HANDLE; { Data Storage Database Handle }
 238
 239
 240{ invalid or NULL value for any CSSM_HANDLE type }
 241const
 242	CSSM_INVALID_HANDLE = 0;
 243
 244
 245{ Data Types for Core Services }
 246
 247type
 248	CSSM_BOOL = SInt32;
 249const
 250	CSSM_FALSE = 0;
 251	CSSM_TRUE = 1;
 252
 253{ The standard declares this as uint32 but we changed it to sint32 to match OSStatus. }
 254type
 255  CSSM_RETURNPtr = ^CSSM_RETURN;
 256	CSSM_RETURN = SInt32;
 257const
 258	CSSM_OK = 0;
 259
 260const
 261	CSSM_MODULE_STRING_SIZE = 64;
 262type
 263	CSSM_STRING = array [0..CSSM_MODULE_STRING_SIZE + 4-1] of char;
 264
 265
 266type
 267	CSSM_DATA_PTR = ^cssm_data;
 268	CSSM_DATAPtr = ^cssm_data;
 269	CSSM_DATAArrayPtr = ^cssm_dataPtr;
 270	cssm_data = record
 271		Length: CSSM_SIZE; { in bytes }
 272		Data: UInt8Ptr;
 273	end;
 274	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 275
 276type
 277	CSSM_GUID_PTR = ^cssm_guid;
 278	CSSM_GUIDPtr = ^cssm_guid;
 279	cssm_guid = record
 280		Data1: UInt32;
 281		Data2: UInt16;
 282		Data3: UInt16;
 283		Data4: array [0..8-1] of UInt8;
 284	end;
 285	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 286
 287type
 288	CSSM_BITMASK = UInt32;
 289	CSSM_KEY_HIERARCHY = CSSM_BITMASK;
 290const
 291	CSSM_KEY_HIERARCHY_NONE = 0;
 292	CSSM_KEY_HIERARCHY_INTEG = 1;
 293	CSSM_KEY_HIERARCHY_EXPORT = 2;
 294
 295type
 296	CSSM_PVC_MODE = CSSM_BITMASK;
 297const
 298	CSSM_PVC_NONE = 0;
 299	CSSM_PVC_APP = 1;
 300	CSSM_PVC_SP = 2;
 301
 302type
 303	CSSM_PRIVILEGE_SCOPE = UInt32;
 304const
 305	CSSM_PRIVILEGE_SCOPE_NONE = 0;
 306	CSSM_PRIVILEGE_SCOPE_PROCESS = 1;
 307	CSSM_PRIVILEGE_SCOPE_THREAD = 2;
 308
 309type
 310	CSSM_VERSION_PTR = ^cssm_version;
 311	CSSM_VERSIONPtr = ^cssm_version;
 312	cssm_version = record
 313		Major: UInt32;
 314		Minor: UInt32;
 315	end;
 316	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 317
 318type
 319	CSSM_SERVICE_MASK = UInt32;
 320const
 321	CSSM_SERVICE_CSSM = $1;
 322	CSSM_SERVICE_CSP = $2;
 323	CSSM_SERVICE_DL = $4;
 324	CSSM_SERVICE_CL = $8;
 325	CSSM_SERVICE_TP = $10;
 326	CSSM_SERVICE_AC = $20;
 327	CSSM_SERVICE_KR = $40;
 328
 329type
 330	CSSM_SERVICE_TYPE = CSSM_SERVICE_MASK;
 331
 332type
 333	CSSM_SUBSERVICE_UID_PTR = ^cssm_subservice_uid;
 334	CSSM_SUBSERVICE_UIDPtr = ^cssm_subservice_uid;
 335	cssm_subservice_uid = record
 336		Guid: CSSM_GUID;
 337		Version: CSSM_VERSION;
 338		SubserviceId: UInt32;
 339		SubserviceType: CSSM_SERVICE_TYPE;
 340	end;
 341	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 342
 343type
 344	CSSM_MODULE_EVENT = UInt32;
 345	CSSM_MODULE_EVENT_PTR = ^UInt32;
 346	CSSM_MODULE_EVENTPtr = ^UInt32;
 347const
 348	CSSM_NOTIFY_INSERT = 1;
 349	CSSM_NOTIFY_REMOVE = 2;
 350	CSSM_NOTIFY_FAULT = 3;
 351
 352type
 353	CSSM_API_ModuleEventHandler = function( const (*var*) ModuleGuid: CSSM_GUID; AppNotifyCallbackCtx: UnivPtr; SubserviceId: UInt32; ServiceType: CSSM_SERVICE_TYPE; EventType: CSSM_MODULE_EVENT ): CSSM_RETURN;
 354
 355type
 356	CSSM_ATTACH_FLAGS = UInt32;
 357const
 358	CSSM_ATTACH_READ_ONLY = $00000001;
 359
 360{ Non-export privilege range: (0x00000000 - 0x7FFFFFFF) }
 361{ Vendor specific range: (0x80000000 - 0xFFFFFFFF) }
 362type
 363	CSSM_PRIVILEGE = UInt64;
 364	CSSM_USEE_TAG = CSSM_PRIVILEGE;
 365const
 366	CSSM_USEE_LAST = $FF;
 367	CSSM_USEE_NONE = 0;
 368	CSSM_USEE_DOMESTIC = 1;
 369	CSSM_USEE_FINANCIAL = 2;
 370	CSSM_USEE_KRLE = 3;
 371	CSSM_USEE_KRENT = 4;
 372	CSSM_USEE_SSL = 5;
 373	CSSM_USEE_AUTHENTICATION = 6;
 374	CSSM_USEE_KEYEXCH = 7;
 375	CSSM_USEE_MEDICAL = 8;
 376	CSSM_USEE_INSURANCE = 9;
 377	CSSM_USEE_WEAK = 10;
 378
 379type
 380	CSSM_NET_ADDRESS_TYPE = UInt32;
 381const
 382	CSSM_ADDR_NONE = 0;
 383	CSSM_ADDR_CUSTOM = 1;
 384	CSSM_ADDR_URL = 2; { char* }
 385	CSSM_ADDR_SOCKADDR = 3;
 386	CSSM_ADDR_NAME = 4; { char* - qualified by access method }
 387
 388type
 389	CSSM_NET_ADDRESS_PTR = ^cssm_net_address;
 390	CSSM_NET_ADDRESSPtr = ^cssm_net_address;
 391	cssm_net_address = record
 392		AddressType: CSSM_NET_ADDRESS_TYPE;
 393		Address: CSSM_DATA;
 394	end;
 395	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 396
 397type
 398	CSSM_NET_PROTOCOL = UInt32;
 399const
 400	CSSM_NET_PROTO_NONE = 0;	{ local }
 401	CSSM_NET_PROTO_CUSTOM = 1;	{ proprietary implementation }
 402	CSSM_NET_PROTO_UNSPECIFIED = 2;	{ implementation default }
 403	CSSM_NET_PROTO_LDAP = 3;	{ light weight directory access protocol }
 404	CSSM_NET_PROTO_LDAPS = 4;	{ ldap/ssl where SSL initiates the connection }
 405	CSSM_NET_PROTO_LDAPNS = 5;	{ ldap where ldap negotiates an SSL session }
 406	CSSM_NET_PROTO_X500DAP = 6;	{ x.500 Directory access protocol }
 407	CSSM_NET_PROTO_FTP = 7;	{ ftp for cert/crl fetch }
 408	CSSM_NET_PROTO_FTPS = 8;	{ ftp/ssl/tls where SSL/TLS initiates the connection }
 409	CSSM_NET_PROTO_OCSP = 9;	{ online certificate status protocol }
 410	CSSM_NET_PROTO_CMP = 10;	{ the cert request protocol in PKIX3 }
 411	CSSM_NET_PROTO_CMPS = 11;	{ The ssl/tls derivative of CMP }
 412
 413type
 414	CSSM_CALLBACK = function( OutData: CSSM_DATA_PTR; CallerCtx: UnivPtr ): CSSM_RETURN;
 415
 416type
 417	CSSM_CRYPTO_DATA_PTR = ^cssm_crypto_data;
 418	CSSM_CRYPTO_DATAPtr = ^cssm_crypto_data;
 419	cssm_crypto_data = record
 420		Param: CSSM_DATA;
 421		Callback: CSSM_CALLBACK;
 422		CallerCtx: UnivPtr;
 423	end;
 424	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 425
 426type
 427	CSSM_WORDID_TYPE = SInt32;
 428const
 429	CSSM_WORDID__UNK_ = -1; { not in dictionary }
 430	CSSM_WORDID__NLU_ = 0; { not yet looked up }
 431	CSSM_WORDID__STAR_ = 1;
 432	CSSM_WORDID_A = 2;
 433	CSSM_WORDID_ACL = 3;
 434	CSSM_WORDID_ALPHA = 4;
 435	CSSM_WORDID_B = 5;
 436	CSSM_WORDID_BER = 6;
 437	CSSM_WORDID_BINARY = 7;
 438	CSSM_WORDID_BIOMETRIC = 8;
 439	CSSM_WORDID_C = 9;
 440	CSSM_WORDID_CANCELED = 10;
 441	CSSM_WORDID_CERT = 11;
 442	CSSM_WORDID_COMMENT = 12;
 443	CSSM_WORDID_CRL = 13;
 444	CSSM_WORDID_CUSTOM = 14;
 445	CSSM_WORDID_D = 15;
 446	CSSM_WORDID_DATE = 16;
 447	CSSM_WORDID_DB_DELETE = 17;
 448	CSSM_WORDID_DB_EXEC_STORED_QUERY = 18;
 449	CSSM_WORDID_DB_INSERT = 19;
 450	CSSM_WORDID_DB_MODIFY = 20;
 451	CSSM_WORDID_DB_READ = 21;
 452	CSSM_WORDID_DBS_CREATE = 22;
 453	CSSM_WORDID_DBS_DELETE = 23;
 454	CSSM_WORDID_DECRYPT = 24;
 455	CSSM_WORDID_DELETE = 25;
 456	CSSM_WORDID_DELTA_CRL = 26;
 457	CSSM_WORDID_DER = 27;
 458	CSSM_WORDID_DERIVE = 28;
 459	CSSM_WORDID_DISPLAY = 29;
 460	CSSM_WORDID_DO = 30;
 461	CSSM_WORDID_DSA = 31;
 462	CSSM_WORDID_DSA_SHA1 = 32;
 463	CSSM_WORDID_E = 33;
 464	CSSM_WORDID_ELGAMAL = 34;
 465	CSSM_WORDID_ENCRYPT = 35;
 466	CSSM_WORDID_ENTRY = 36;
 467	CSSM_WORDID_EXPORT_CLEAR = 37;
 468	CSSM_WORDID_EXPORT_WRAPPED = 38;
 469	CSSM_WORDID_G = 39;
 470	CSSM_WORDID_GE = 40;
 471	CSSM_WORDID_GENKEY = 41;
 472	CSSM_WORDID_HASH = 42;
 473	CSSM_WORDID_HASHED_PASSWORD = 43;
 474	CSSM_WORDID_HASHED_SUBJECT = 44;
 475	CSSM_WORDID_HAVAL = 45;
 476	CSSM_WORDID_IBCHASH = 46;
 477	CSSM_WORDID_IMPORT_CLEAR = 47;
 478	CSSM_WORDID_IMPORT_WRAPPED = 48;
 479	CSSM_WORDID_INTEL = 49;
 480	CSSM_WORDID_ISSUER = 50;
 481	CSSM_WORDID_ISSUER_INFO = 51;
 482	CSSM_WORDID_K_OF_N = 52;
 483	CSSM_WORDID_KEA = 53;
 484	CSSM_WORDID_KEYHOLDER = 54;
 485	CSSM_WORDID_L = 55;
 486	CSSM_WORDID_LE = 56;
 487	CSSM_WORDID_LOGIN = 57;
 488	CSSM_WORDID_LOGIN_NAME = 58;
 489	CSSM_WORDID_MAC = 59;
 490	CSSM_WORDID_MD2 = 60;
 491	CSSM_WORDID_MD2WITHRSA = 61;
 492	CSSM_WORDID_MD4 = 62;
 493	CSSM_WORDID_MD5 = 63;
 494	CSSM_WORDID_MD5WITHRSA = 64;
 495	CSSM_WORDID_N = 65;
 496	CSSM_WORDID_NAME = 66;
 497	CSSM_WORDID_NDR = 67;
 498	CSSM_WORDID_NHASH = 68;
 499	CSSM_WORDID_NOT_AFTER = 69;
 500	CSSM_WORDID_NOT_BEFORE = 70;
 501	CSSM_WORDID_NULL = 71;
 502	CSSM_WORDID_NUMERIC = 72;
 503	CSSM_WORDID_OBJECT_HASH = 73;
 504	CSSM_WORDID_ONE_TIME = 74;
 505	CSSM_WORDID_ONLINE = 75;
 506	CSSM_WORDID_OWNER = 76;
 507	CSSM_WORDID_P = 77;
 508	CSSM_WORDID_PAM_NAME = 78;
 509	CSSM_WORDID_PASSWORD = 79;
 510	CSSM_WORDID_PGP = 80;
 511	CSSM_WORDID_PREFIX = 81;
 512	CSSM_WORDID_PRIVATE_KEY = 82;
 513	CSSM_WORDID_PROMPTED_BIOMETRIC = 83;
 514	CSSM_WORDID_PROMPTED_PASSWORD = 84;
 515	CSSM_WORDID_PROPAGATE = 85;
 516	CSSM_WORDID_PROTECTED_BIOMETRIC = 86;
 517	CSSM_WORDID_PROTECTED_PASSWORD = 87;
 518	CSSM_WORDID_PROTECTED_PIN = 88;
 519	CSSM_WORDID_PUBLIC_KEY = 89;
 520	CSSM_WORDID_PUBLIC_KEY_FROM_CERT = 90;
 521	CSSM_WORDID_Q = 91;
 522	CSSM_WORDID_RANGE = 92;
 523	CSSM_WORDID_REVAL = 93;
 524	CSSM_WORDID_RIPEMAC = 94;
 525	CSSM_WORDID_RIPEMD = 95;
 526	CSSM_WORDID_RIPEMD160 = 96;
 527	CSSM_WORDID_RSA = 97;
 528	CSSM_WORDID_RSA_ISO9796 = 98;
 529	CSSM_WORDID_RSA_PKCS = 99;
 530	CSSM_WORDID_RSA_PKCS_MD5 = 100;
 531	CSSM_WORDID_RSA_PKCS_SHA1 = 101;
 532	CSSM_WORDID_RSA_PKCS1 = 102;
 533	CSSM_WORDID_RSA_PKCS1_MD5 = 103;
 534	CSSM_WORDID_RSA_PKCS1_SHA1 = 104;
 535	CSSM_WORDID_RSA_PKCS1_SIG = 105;
 536	CSSM_WORDID_RSA_RAW = 106;
 537	CSSM_WORDID_SDSIV1 = 107;
 538	CSSM_WORDID_SEQUENCE = 108;
 539	CSSM_WORDID_SET = 109;
 540	CSSM_WORDID_SEXPR = 110;
 541	CSSM_WORDID_SHA1 = 111;
 542	CSSM_WORDID_SHA1WITHDSA = 112;
 543	CSSM_WORDID_SHA1WITHECDSA = 113;
 544	CSSM_WORDID_SHA1WITHRSA = 114;
 545	CSSM_WORDID_SIGN = 115;
 546	CSSM_WORDID_SIGNATURE = 116;
 547	CSSM_WORDID_SIGNED_NONCE = 117;
 548	CSSM_WORDID_SIGNED_SECRET = 118;
 549	CSSM_WORDID_SPKI = 119;
 550	CSSM_WORDID_SUBJECT = 120;
 551	CSSM_WORDID_SUBJECT_INFO = 121;
 552	CSSM_WORDID_TAG = 122;
 553	CSSM_WORDID_THRESHOLD = 123;
 554	CSSM_WORDID_TIME = 124;
 555	CSSM_WORDID_URI = 125;
 556	CSSM_WORDID_VERSION = 126;
 557	CSSM_WORDID_X509_ATTRIBUTE = 127;
 558	CSSM_WORDID_X509V1 = 128;
 559	CSSM_WORDID_X509V2 = 129;
 560	CSSM_WORDID_X509V3 = 130;
 561	CSSM_WORDID_X9_ATTRIBUTE = 131;
 562	CSSM_WORDID_VENDOR_START = $00010000;
 563	CSSM_WORDID_VENDOR_END = $7FFF0000;
 564
 565type
 566	CSSM_LIST_ELEMENT_TYPE = UInt32;
 567	CSSM_LIST_ELEMENT_TYPE_PTR = ^UInt32;
 568	CSSM_LIST_ELEMENT_TYPEPtr = ^UInt32;
 569const
 570	CSSM_LIST_ELEMENT_DATUM = $00;
 571	CSSM_LIST_ELEMENT_SUBLIST = $01;
 572	CSSM_LIST_ELEMENT_WORDID = $02;
 573
 574type
 575	CSSM_LIST_TYPE = UInt32;
 576	CSSM_LIST_TYPE_PTR = ^UInt32;
 577	CSSM_LIST_TYPEPtr = ^UInt32;
 578const
 579	CSSM_LIST_TYPE_UNKNOWN = 0;
 580	CSSM_LIST_TYPE_CUSTOM = 1;
 581	CSSM_LIST_TYPE_SEXPR = 2;
 582
 583type
 584  CSSM_LIST_ELEMENT_PTR = ^cssm_list_element;
 585  CSSM_LIST_ELEMENTPtr = ^cssm_list_element;
 586	CSSM_LIST_PTR = ^cssm_list;
 587	CSSM_LISTPtr = ^cssm_list;
 588	cssm_list = record
 589		ListType: CSSM_LIST_TYPE;	{ type of this list }
 590		Head: CSSM_LIST_ELEMENT_PTR;	{ head of the list }
 591		Tail: CSSM_LIST_ELEMENT_PTR;	{ tail of the list }
 592	end;
 593	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 594
 595  __embedded_cssm_list_element = record
 596    case Integer of
 597      0: (Sublist: CSSM_LIST);		{ sublist }
 598      1: (Word: CSSM_DATA);		{ a byte-string }
 599  end;
 600
 601	cssm_list_element = record
 602		NextElement: cssm_list_element_ptr;	{ next list element }
 603		WordID: CSSM_WORDID_TYPE;	{ integer identifier associated }
 604								{ with a Word value }
 605		ElementType: CSSM_LIST_ELEMENT_TYPE;
 606		Element: __embedded_cssm_list_element;
 607	end;
 608
 609type
 610	CSSM_TUPLE_PTR = ^CSSM_TUPLE;
 611	CSSM_TUPLEPtr = ^CSSM_TUPLE;
 612	CSSM_TUPLE = record
 613{ 5-tuple definition }
 614		Issuer: CSSM_LIST;			{ issuer, or empty if ACL }
 615		Subject: CSSM_LIST;			{ subject }
 616		Delegate: CSSM_BOOL;			{ permission to delegate }
 617		AuthorizationTag: CSSM_LIST;	{ authorization field }
 618		ValidityPeriod: CSSM_LIST;	{ validity information (dates) }
 619	end;
 620	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 621
 622type
 623	CSSM_TUPLEGROUP_PTR = ^cssm_tuplegroup;
 624	CSSM_TUPLEGROUPPtr = ^cssm_tuplegroup;
 625	cssm_tuplegroup = record
 626		NumberOfTuples: UInt32;
 627		Tuples: CSSM_TUPLE_PTR;
 628	end;
 629	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 630
 631type
 632	CSSM_SAMPLE_TYPE = CSSM_WORDID_TYPE;
 633const
 634	CSSM_SAMPLE_TYPE_PASSWORD = CSSM_WORDID_PASSWORD;
 635	CSSM_SAMPLE_TYPE_HASHED_PASSWORD = CSSM_WORDID_HASHED_PASSWORD;
 636	CSSM_SAMPLE_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD;
 637	CSSM_SAMPLE_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD;
 638	CSSM_SAMPLE_TYPE_SIGNED_NONCE = CSSM_WORDID_SIGNED_NONCE;
 639	CSSM_SAMPLE_TYPE_SIGNED_SECRET = CSSM_WORDID_SIGNED_SECRET;
 640	CSSM_SAMPLE_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC;
 641	CSSM_SAMPLE_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC;
 642	CSSM_SAMPLE_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC;
 643	CSSM_SAMPLE_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD;
 644
 645type
 646	CSSM_SAMPLE_PTR = ^cssm_sample;
 647	CSSM_SAMPLEPtr = ^cssm_sample;
 648	cssm_sample = record
 649		TypedSample: CSSM_LIST;
 650		Verifier: {const} CSSM_SUBSERVICE_UIDPtr;
 651	end;
 652	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 653
 654type
 655	CSSM_SAMPLEGROUP_PTR = ^cssm_samplegroup;
 656	CSSM_SAMPLEGROUPPtr = ^cssm_samplegroup;
 657	cssm_samplegroup = record
 658		NumberOfSamples: UInt32;
 659		Samples: {const} CSSM_SAMPLEPtr;
 660	end;
 661	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 662
 663type
 664	CSSM_MALLOC = function( size: CSSM_SIZE; allocref: UnivPtr ): UnivPtr;
 665
 666type
 667	CSSM_FREE = procedure( memblock: UnivPtr; allocref: UnivPtr );
 668
 669type
 670	CSSM_REALLOC = function( memblock: UnivPtr; size: CSSM_SIZE; allocref: UnivPtr ): UnivPtr;
 671
 672type
 673	CSSM_CALLOC = function( num: UInt32; size: CSSM_SIZE; allocref: UnivPtr ): UnivPtr;
 674
 675type
 676	CSSM_MEMORY_FUNCS_PTR = ^cssm_memory_funcs;
 677	CSSM_MEMORY_FUNCSPtr = ^cssm_memory_funcs;
 678	cssm_memory_funcs = record
 679		malloc_func: CSSM_MALLOC;
 680		free_func: CSSM_FREE;
 681		realloc_func: CSSM_REALLOC;
 682		calloc_func: CSSM_CALLOC;
 683		AllocRef: UnivPtr;
 684	end;
 685	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 686
 687type
 688	CSSM_API_MEMORY_FUNCS = CSSM_MEMORY_FUNCS;
 689	CSSM_API_MEMORY_FUNCS_PTR = ^CSSM_API_MEMORY_FUNCS;
 690	CSSM_API_MEMORY_FUNCSPtr = ^CSSM_API_MEMORY_FUNCS;
 691
 692type
 693	CSSM_CHALLENGE_CALLBACK = function( const (*var*) Challenge: CSSM_LIST; Response: CSSM_SAMPLEGROUP_PTR; CallerCtx: UnivPtr; const (*var*) MemFuncs: CSSM_MEMORY_FUNCS ): CSSM_RETURN;
 694
 695type
 696	CSSM_CERT_TYPE = UInt32;
 697	CSSM_CERT_TYPE_PTR = ^UInt32;
 698	CSSM_CERT_TYPEPtr = ^UInt32;
 699const
 700	CSSM_CERT_UNKNOWN = $00;
 701	CSSM_CERT_X_509v1 = $01;
 702	CSSM_CERT_X_509v2 = $02;
 703	CSSM_CERT_X_509v3 = $03;
 704	CSSM_CERT_PGP = $04;
 705	CSSM_CERT_SPKI = $05;
 706	CSSM_CERT_SDSIv1 = $06;
 707	CSSM_CERT_Intel = $08;
 708	CSSM_CERT_X_509_ATTRIBUTE = $09; { X.509 attribute cert }
 709	CSSM_CERT_X9_ATTRIBUTE = $0A; { X9 attribute cert }
 710	CSSM_CERT_TUPLE = $0B;
 711	CSSM_CERT_ACL_ENTRY = $0C;
 712	CSSM_CERT_MULTIPLE = $7FFE;
 713	CSSM_CERT_LAST = $7FFF;
 714	{ Applications wishing to define their own custom certificate
 715	   type should define and publicly document a uint32 value greater
 716	   than the CSSM_CL_CUSTOM_CERT_TYPE }
 717	CSSM_CL_CUSTOM_CERT_TYPE = $08000;
 718
 719type
 720	CSSM_CERT_ENCODING = UInt32;
 721	CSSM_CERT_ENCODING_PTR = ^UInt32;
 722	CSSM_CERT_ENCODINGPtr = ^UInt32;
 723const
 724	CSSM_CERT_ENCODING_UNKNOWN = $00;
 725	CSSM_CERT_ENCODING_CUSTOM = $01;
 726	CSSM_CERT_ENCODING_BER = $02;
 727	CSSM_CERT_ENCODING_DER = $03;
 728	CSSM_CERT_ENCODING_NDR = $04;
 729	CSSM_CERT_ENCODING_SEXPR = $05;
 730	CSSM_CERT_ENCODING_PGP = $06;
 731	CSSM_CERT_ENCODING_MULTIPLE = $7FFE;
 732	CSSM_CERT_ENCODING_LAST = $7FFF;
 733	{ Applications wishing to define their own custom certificate
 734	   encoding should create a uint32 value greater than the
 735	   CSSM_CL_CUSTOM_CERT_ENCODING }
 736	CSSM_CL_CUSTOM_CERT_ENCODING = $8000;
 737
 738type
 739	CSSM_ENCODED_CERT_PTR = ^cssm_encoded_cert;
 740	CSSM_ENCODED_CERTPtr = ^cssm_encoded_cert;
 741	cssm_encoded_cert = record
 742		CertType: CSSM_CERT_TYPE;			{ type of certificate }
 743		CertEncoding: CSSM_CERT_ENCODING;	{ encoding for this packed cert }
 744		CertBlob: CSSM_DATA;					{ packed cert }
 745	end;
 746	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 747
 748type
 749	CSSM_CERT_PARSE_FORMAT = UInt32;
 750	CSSM_CERT_PARSE_FORMAT_PTR = ^UInt32;
 751	CSSM_CERT_PARSE_FORMATPtr = ^UInt32;
 752const
 753	CSSM_CERT_PARSE_FORMAT_NONE = $00;
 754	CSSM_CERT_PARSE_FORMAT_CUSTOM = $01; { void* }
 755	CSSM_CERT_PARSE_FORMAT_SEXPR = $02; { CSSM_LIST }
 756	CSSM_CERT_PARSE_FORMAT_COMPLEX = $03; { void* }
 757	CSSM_CERT_PARSE_FORMAT_OID_NAMED = $04; { CSSM_FIELDGROUP }
 758	CSSM_CERT_PARSE_FORMAT_TUPLE = $05; { CSSM_TUPLE }
 759	CSSM_CERT_PARSE_FORMAT_MULTIPLE = $7FFE;
 760{ multiple forms, each cert carries a
 761   parse format indicator }
 762	CSSM_CERT_PARSE_FORMAT_LAST = $7FFF;
 763{ Applications wishing to define their
 764   own custom parse format should create
 765   a * uint32 value greater than the
 766   CSSM_CL_CUSTOM_CERT_PARSE_FORMAT }
 767	CSSM_CL_CUSTOM_CERT_PARSE_FORMAT = $8000;
 768
 769type
 770	CSSM_PARSED_CERT_PTR = ^cssm_parsed_cert;
 771	CSSM_PARSED_CERTPtr = ^cssm_parsed_cert;
 772	cssm_parsed_cert = record
 773		CertType: CSSM_CERT_TYPE; { certificate type }
 774		ParsedCertFormat: CSSM_CERT_PARSE_FORMAT;
 775    { struct of ParsedCert }
 776		ParsedCert: UnivPtr; { parsed cert (to be typecast) }
 777	end;
 778	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 779
 780type
 781	CSSM_CERT_PAIR_PTR = ^cssm_cert_pair;
 782	CSSM_CERT_PAIRPtr = ^cssm_cert_pair;
 783	cssm_cert_pair = record
 784		EncodedCert: CSSM_ENCODED_CERT; { an encoded certificate blob }
 785		ParsedCert: CSSM_PARSED_CERT; { equivalent parsed certificate }
 786	end;
 787	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 788
 789type
 790	CSSM_CERTGROUP_TYPE = UInt32;
 791	CSSM_CERTGROUP_TYPE_PTR = ^UInt32;
 792	CSSM_CERTGROUP_TYPEPtr = ^UInt32;
 793const
 794	CSSM_CERTGROUP_DATA = $00;
 795	CSSM_CERTGROUP_ENCODED_CERT = $01;
 796	CSSM_CERTGROUP_PARSED_CERT = $02;
 797	CSSM_CERTGROUP_CERT_PAIR = $03;
 798
 799type
 800  __EmbeddedGroupListType = record
 801    case Integer of
 802      0: (CertList: CSSM_DATA_PTR); { legacy list of single type certificate blobs }
 803		  1: (EncodedCertList: CSSM_ENCODED_CERT_PTR);
 804        { list of multi-type certificate blobs }
 805		  2: (ParsedCertList: CSSM_PARSED_CERT_PTR);
 806        { list of multi-type parsed certs }
 807		  3: (PairCertList: CSSM_CERT_PAIR_PTR);
 808        {list of single or multi-type certs with two representations: blob and parsed }
 809	end;
 810	cssm_certgroup = record
 811		CertType: CSSM_CERT_TYPE;
 812		CertEncoding: CSSM_CERT_ENCODING;
 813		NumCerts: UInt32; { # of certificates in this list }
 814    CertGroupType: __EmbeddedGroupListType;
 815    { type of structure in the GroupList }
 816    Reserved: UnivPtr; { reserved for implementation dependent use }
 817  end;
 818  cssm_certgroup_ptr = ^cssm_certgroup;
 819  CSSM_certgroupPtr = ^cssm_certgroup;
 820
 821type
 822	CSSM_BASE_CERTS_PTR = ^cssm_base_certs;
 823	CSSM_BASE_CERTSPtr = ^cssm_base_certs;
 824	cssm_base_certs = record
 825		TPHandle: CSSM_TP_HANDLE;
 826		CLHandle: CSSM_CL_HANDLE;
 827		Certs: CSSM_CERTGROUP;
 828	end;
 829	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 830
 831type
 832	CSSM_ACCESS_CREDENTIALS_PTR = ^cssm_access_credentials;
 833	CSSM_ACCESS_CREDENTIALSPtr = ^cssm_access_credentials;
 834	cssm_access_credentials = record
 835		EntryTag: CSSM_STRING;
 836		BaseCerts: CSSM_BASE_CERTS;
 837		Samples: CSSM_SAMPLEGROUP;
 838		Callback: CSSM_CHALLENGE_CALLBACK;
 839		CallerCtx: UnivPtr;
 840	end;
 841	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 842
 843type
 844	CSSM_ACL_SUBJECT_TYPE = SInt32;
 845const
 846	CSSM_ACL_SUBJECT_TYPE_ANY = CSSM_WORDID__STAR_;
 847	CSSM_ACL_SUBJECT_TYPE_THRESHOLD = CSSM_WORDID_THRESHOLD;
 848	CSSM_ACL_SUBJECT_TYPE_PASSWORD = CSSM_WORDID_PASSWORD;
 849	CSSM_ACL_SUBJECT_TYPE_PROTECTED_PASSWORD = CSSM_WORDID_PROTECTED_PASSWORD;
 850	CSSM_ACL_SUBJECT_TYPE_PROMPTED_PASSWORD = CSSM_WORDID_PROMPTED_PASSWORD;
 851	CSSM_ACL_SUBJECT_TYPE_PUBLIC_KEY = CSSM_WORDID_PUBLIC_KEY;
 852	CSSM_ACL_SUBJECT_TYPE_HASHED_SUBJECT = CSSM_WORDID_HASHED_SUBJECT;
 853	CSSM_ACL_SUBJECT_TYPE_BIOMETRIC = CSSM_WORDID_BIOMETRIC;
 854	CSSM_ACL_SUBJECT_TYPE_PROTECTED_BIOMETRIC = CSSM_WORDID_PROTECTED_BIOMETRIC;
 855	CSSM_ACL_SUBJECT_TYPE_PROMPTED_BIOMETRIC = CSSM_WORDID_PROMPTED_BIOMETRIC;
 856	CSSM_ACL_SUBJECT_TYPE_LOGIN_NAME = CSSM_WORDID_LOGIN_NAME;
 857	CSSM_ACL_SUBJECT_TYPE_EXT_PAM_NAME = CSSM_WORDID_PAM_NAME;
 858
 859{ Authorization tag type }
 860type
 861	CSSM_ACL_AUTHORIZATION_TAG = SInt32;
 862	CSSM_ACL_AUTHORIZATION_TAGPtr = ^CSSM_ACL_AUTHORIZATION_TAG;
 863const
 864{ All vendor specific constants must be in the number range
 865	   starting at CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START }
 866	CSSM_ACL_AUTHORIZATION_TAG_VENDOR_DEFINED_START = $00010000;
 867	{ No restrictions. Permission to perform all operations on
 868	   the resource or available to an ACL owner.  }
 869	CSSM_ACL_AUTHORIZATION_ANY = CSSM_WORDID__STAR_;
 870	{ Defined authorization tag values for CSPs }
 871	CSSM_ACL_AUTHORIZATION_LOGIN = CSSM_WORDID_LOGIN;
 872	CSSM_ACL_AUTHORIZATION_GENKEY = CSSM_WORDID_GENKEY;
 873	CSSM_ACL_AUTHORIZATION_DELETE = CSSM_WORDID_DELETE;
 874	CSSM_ACL_AUTHORIZATION_EXPORT_WRAPPED = CSSM_WORDID_EXPORT_WRAPPED;
 875	CSSM_ACL_AUTHORIZATION_EXPORT_CLEAR = CSSM_WORDID_EXPORT_CLEAR;
 876	CSSM_ACL_AUTHORIZATION_IMPORT_WRAPPED = CSSM_WORDID_IMPORT_WRAPPED;
 877	CSSM_ACL_AUTHORIZATION_IMPORT_CLEAR = CSSM_WORDID_IMPORT_CLEAR;
 878	CSSM_ACL_AUTHORIZATION_SIGN = CSSM_WORDID_SIGN;
 879	CSSM_ACL_AUTHORIZATION_ENCRYPT = CSSM_WORDID_ENCRYPT;
 880	CSSM_ACL_AUTHORIZATION_DECRYPT = CSSM_WORDID_DECRYPT;
 881	CSSM_ACL_AUTHORIZATION_MAC = CSSM_WORDID_MAC;
 882	CSSM_ACL_AUTHORIZATION_DERIVE = CSSM_WORDID_DERIVE;
 883	{ Defined authorization tag values for DLs }
 884	CSSM_ACL_AUTHORIZATION_DBS_CREATE = CSSM_WORDID_DBS_CREATE;
 885	CSSM_ACL_AUTHORIZATION_DBS_DELETE = CSSM_WORDID_DBS_DELETE;
 886	CSSM_ACL_AUTHORIZATION_DB_READ = CSSM_WORDID_DB_READ;
 887	CSSM_ACL_AUTHORIZATION_DB_INSERT = CSSM_WORDID_DB_INSERT;
 888	CSSM_ACL_AUTHORIZATION_DB_MODIFY = CSSM_WORDID_DB_MODIFY;
 889	CSSM_ACL_AUTHORIZATION_DB_DELETE = CSSM_WORDID_DB_DELETE;
 890
 891type
 892	CSSM_AUTHORIZATIONGROUP_PTR = ^cssm_authorizationgroup;
 893	CSSM_AUTHORIZATIONGROUPPtr = ^cssm_authorizationgroup;
 894	cssm_authorizationgroup = record
 895		NumberOfAuthTags: UInt32;
 896		AuthTags: CSSM_ACL_AUTHORIZATION_TAGPtr;
 897	end;
 898	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 899
 900type
 901	CSSM_ACL_VALIDITY_PERIOD_PTR = ^cssm_acl_validity_period;
 902	CSSM_ACL_VALIDITY_PERIODPtr = ^cssm_acl_validity_period;
 903	cssm_acl_validity_period = record
 904		StartDate: CSSM_DATA;
 905		EndDate: CSSM_DATA;
 906	end;
 907	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 908
 909type
 910	CSSM_ACL_ENTRY_PROTOTYPE_PTR = ^cssm_acl_entry_prototype;
 911	CSSM_ACL_ENTRY_PROTOTYPEPtr = ^cssm_acl_entry_prototype;
 912	cssm_acl_entry_prototype = record
 913		TypedSubject: CSSM_LIST;
 914		Delegate: CSSM_BOOL;
 915		Authorization: CSSM_AUTHORIZATIONGROUP;
 916		TimeRange: CSSM_ACL_VALIDITY_PERIOD;
 917		EntryTag: CSSM_STRING;
 918	end;
 919	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 920
 921type
 922	CSSM_ACL_OWNER_PROTOTYPE_PTR = ^cssm_acl_owner_prototype;
 923	CSSM_ACL_OWNER_PROTOTYPEPtr = ^cssm_acl_owner_prototype;
 924	cssm_acl_owner_prototype = record
 925		TypedSubject: CSSM_LIST;
 926		Delegate: CSSM_BOOL;
 927	end;
 928	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 929
 930type
 931	CSSM_ACL_SUBJECT_CALLBACK = function( const (*var*) SubjectRequest: CSSM_LIST; SubjectResponse: CSSM_LIST_PTR; CallerContext: UnivPtr; const (*var*) MemFuncs: CSSM_MEMORY_FUNCS ): CSSM_RETURN;
 932
 933type
 934	CSSM_ACL_ENTRY_INPUT_PTR = ^cssm_acl_entry_input;
 935	CSSM_ACL_ENTRY_INPUTPtr = ^cssm_acl_entry_input;
 936	cssm_acl_entry_input = record
 937		Prototype: CSSM_ACL_ENTRY_PROTOTYPE;
 938		Callback: CSSM_ACL_SUBJECT_CALLBACK;
 939		CallerContext: UnivPtr;
 940	end;
 941	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 942
 943type
 944	CSSM_RESOURCE_CONTROL_CONTEXT_PTR = ^cssm_resource_control_context;
 945	CSSM_RESOURCE_CONTROL_CONTEXTPtr = ^cssm_resource_control_context;
 946	cssm_resource_control_context = record
 947		AccessCred: CSSM_ACCESS_CREDENTIALS_PTR;
 948		InitialAclEntry: CSSM_ACL_ENTRY_INPUT;
 949	end;
 950	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 951
 952type
 953	CSSM_ACL_HANDLE = CSSM_HANDLE;
 954
 955type
 956	CSSM_ACL_ENTRY_INFO_PTR = ^cssm_acl_entry_info;
 957	CSSM_ACL_ENTRY_INFOPtr = ^cssm_acl_entry_info;
 958	cssm_acl_entry_info = record
 959		EntryPublicInfo: CSSM_ACL_ENTRY_PROTOTYPE;
 960		EntryHandle: CSSM_ACL_HANDLE;
 961	end;
 962	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 963
 964type
 965	CSSM_ACL_EDIT_MODE = UInt32;
 966const
 967	CSSM_ACL_EDIT_MODE_ADD = 1;
 968	CSSM_ACL_EDIT_MODE_DELETE = 2;
 969	CSSM_ACL_EDIT_MODE_REPLACE = 3;
 970
 971type
 972	CSSM_ACL_EDIT_PTR = ^cssm_acl_edit;
 973	CSSM_ACL_EDITPtr = ^cssm_acl_edit;
 974	cssm_acl_edit = record
 975		EditMode: CSSM_ACL_EDIT_MODE;
 976		OldEntryHandle: CSSM_ACL_HANDLE;
 977		NewEntry: {const} CSSM_ACL_ENTRY_INPUTPtr;
 978	end;
 979	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
 980
 981{$ifc defined(WIN32)}
 982type
 983	CSSM_PROC_ADDR = FARPROC;
 984{$elsec}
 985type
 986	CSSM_PROC_ADDR = procedure;
 987{$endc}
 988  CSSM_PROC_ADDRPtr = ^CSSM_PROC_ADDR;
 989type
 990	CSSM_PROC_ADDR_PTR = CSSM_PROC_ADDRPtr;
 991
 992type
 993	CSSM_FUNC_NAME_ADDR_PTR = ^cssm_func_name_addr;
 994	CSSM_FUNC_NAME_ADDRPtr = ^cssm_func_name_addr;
 995	cssm_func_name_addr = record
 996		Name: CSSM_STRING;
 997		Address: CSSM_PROC_ADDR;
 998	end;
 999	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1000
1001
1002{ Data Types for Cryptographic Services  }
1003
1004type
1005	CSSM_DATE_PTR = ^cssm_date;
1006	CSSM_DATEPtr = ^cssm_date;
1007	cssm_date = record
1008		Year: array [0..4-1] of UInt8;
1009		Month: array [0..2-1] of UInt8;
1010		Day: array [0..2-1] of UInt8;
1011	end;
1012	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1013
1014type
1015	CSSM_RANGE_PTR = ^cssm_range;
1016	CSSM_RANGEPtr = ^cssm_range;
1017	cssm_range = record
1018		Min: UInt32; { inclusive minimum value }
1019		Max: UInt32; { inclusive maximum value }
1020	end;
1021	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1022
1023type
1024	CSSM_QUERY_SIZE_DATA_PTR = ^cssm_query_size_data;
1025	CSSM_QUERY_SIZE_DATAPtr = ^cssm_query_size_data;
1026	cssm_query_size_data = record
1027		SizeInputBlock: UInt32; { size of input data block }
1028		SizeOutputBlock: UInt32; { size of resulting output data block }
1029	end;
1030	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1031
1032type
1033	CSSM_HEADERVERSION = UInt32;
1034const
1035	CSSM_KEYHEADER_VERSION = 2;
1036
1037type
1038	CSSM_KEY_SIZE_PTR = ^cssm_key_size;
1039	CSSM_KEY_SIZEPtr = ^cssm_key_size;
1040	cssm_key_size = record
1041		LogicalKeySizeInBits: UInt32; { Logical key size in bits }
1042		EffectiveKeySizeInBits: UInt32; { Effective key size in bits }
1043	end;
1044	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1045
1046type
1047	CSSM_KEYBLOB_TYPE = UInt32;
1048const
1049	CSSM_KEYBLOB_RAW = 0; { The blob is a clear, raw key }
1050	CSSM_KEYBLOB_REFERENCE = 2; { The blob is a reference to a key }
1051	CSSM_KEYBLOB_WRAPPED = 3; { The blob is a wrapped RAW key }
1052	CSSM_KEYBLOB_OTHER = $FFFFFFFF;
1053
1054type
1055	CSSM_KEYBLOB_FORMAT = UInt32;
1056const
1057{ Raw Format }
1058	CSSM_KEYBLOB_RAW_FORMAT_NONE = 0;
1059	{ No further conversion need to be done }
1060	CSSM_KEYBLOB_RAW_FORMAT_PKCS1 = 1; { RSA PKCS1 V1.5 }
1061	CSSM_KEYBLOB_RAW_FORMAT_PKCS3 = 2; { RSA PKCS3 V1.5 }
1062	CSSM_KEYBLOB_RAW_FORMAT_MSCAPI = 3; { Microsoft CAPI V2.0 }
1063	CSSM_KEYBLOB_RAW_FORMAT_PGP = 4; { PGP V }
1064	CSSM_KEYBLOB_RAW_FORMAT_FIPS186 = 5; { US Gov. FIPS 186 - DSS V }
1065	CSSM_KEYBLOB_RAW_FORMAT_BSAFE = 6; { RSA Bsafe V3.0 }
1066	CSSM_KEYBLOB_RAW_FORMAT_CCA = 9; { CCA clear public key blob }
1067	CSSM_KEYBLOB_RAW_FORMAT_PKCS8 = 10; { RSA PKCS8 V1.2 }
1068	CSSM_KEYBLOB_RAW_FORMAT_SPKI = 11; { SPKI Specification }
1069	CSSM_KEYBLOB_RAW_FORMAT_OCTET_STRING = 12;
1070	CSSM_KEYBLOB_RAW_FORMAT_OTHER = $FFFFFFFF; { Other, CSP defined }
1071const
1072{ Wrapped Format }
1073	CSSM_KEYBLOB_WRAPPED_FORMAT_NONE = 0;
1074	{ No further conversion need to be done }
1075	CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS8 = 1; { RSA PKCS8 V1.2 }
1076	CSSM_KEYBLOB_WRAPPED_FORMAT_PKCS7 = 2;
1077	CSSM_KEYBLOB_WRAPPED_FORMAT_MSCAPI = 3;
1078	CSSM_KEYBLOB_WRAPPED_FORMAT_OTHER = $FFFFFFFF; { Other, CSP defined }
1079const
1080{ Reference Format }
1081	CSSM_KEYBLOB_REF_FORMAT_INTEGER = 0;	{ Reference is a number or handle }
1082	CSSM_KEYBLOB_REF_FORMAT_STRING = 1;	{ Reference is a string or label }
1083	CSSM_KEYBLOB_REF_FORMAT_SPKI = 2;	{ Reference is an SPKI S-expression }
1084												{ to be evaluated to locate the key }
1085	CSSM_KEYBLOB_REF_FORMAT_OTHER = $FFFFFFFF;	{ Other, CSP defined }
1086
1087type
1088	CSSM_KEYCLASS = UInt32;
1089const
1090	CSSM_KEYCLASS_PUBLIC_KEY = 0; { Key is public key }
1091	CSSM_KEYCLASS_PRIVATE_KEY = 1; { Key is private key }
1092	CSSM_KEYCLASS_SESSION_KEY = 2; { Key is session or symmetric key }
1093	CSSM_KEYCLASS_SECRET_PART = 3; { Key is part of secret key }
1094	CSSM_KEYCLASS_OTHER = $FFFFFFFF; { Other }
1095
1096type
1097	CSSM_KEYATTR_FLAGS = UInt32;
1098const
1099{ Valid only during call to an API. Will never be valid when set in a key header }
1100	CSSM_KEYATTR_RETURN_DEFAULT = $00000000;
1101	CSSM_KEYATTR_RETURN_DATA = $10000000;
1102	CSSM_KEYATTR_RETURN_REF = $20000000;
1103	CSSM_KEYATTR_RETURN_NONE = $40000000;
1104	{ Valid during an API call and in a key header }
1105	CSSM_KEYATTR_PERMANENT = $00000001;
1106	CSSM_KEYATTR_PRIVATE = $00000002;
1107	CSSM_KEYATTR_MODIFIABLE = $00000004;
1108	CSSM_KEYATTR_SENSITIVE = $00000008;
1109	CSSM_KEYATTR_EXTRACTABLE = $00000020;
1110	{ Valid only in a key header generated by a CSP, not valid during an API call }
1111	CSSM_KEYATTR_ALWAYS_SENSITIVE = $00000010;
1112	CSSM_KEYATTR_NEVER_EXTRACTABLE = $00000040;
1113
1114type
1115	CSSM_KEYUSE = UInt32;
1116const
1117	CSSM_KEYUSE_ANY = $80000000;
1118	CSSM_KEYUSE_ENCRYPT = $00000001;
1119	CSSM_KEYUSE_DECRYPT = $00000002;
1120	CSSM_KEYUSE_SIGN = $00000004;
1121	CSSM_KEYUSE_VERIFY = $00000008;
1122	CSSM_KEYUSE_SIGN_RECOVER = $00000010;
1123	CSSM_KEYUSE_VERIFY_RECOVER = $00000020;
1124	CSSM_KEYUSE_WRAP = $00000040;
1125	CSSM_KEYUSE_UNWRAP = $00000080;
1126	CSSM_KEYUSE_DERIVE = $00000100;
1127
1128type
1129	CSSM_ALGORITHMS = UInt32;
1130const
1131	CSSM_ALGID_NONE = 0;
1132	CSSM_ALGID_CUSTOM = CSSM_ALGID_NONE + 1;
1133	CSSM_ALGID_DH = CSSM_ALGID_NONE + 2;
1134	CSSM_ALGID_PH = CSSM_ALGID_NONE + 3;
1135	CSSM_ALGID_KEA = CSSM_ALGID_NONE + 4;
1136	CSSM_ALGID_MD2 = CSSM_ALGID_NONE + 5;
1137	CSSM_ALGID_MD4 = CSSM_ALGID_NONE + 6;
1138	CSSM_ALGID_MD5 = CSSM_ALGID_NONE + 7;
1139	CSSM_ALGID_SHA1 = CSSM_ALGID_NONE + 8;
1140	CSSM_ALGID_NHASH = CSSM_ALGID_NONE + 9;
1141	CSSM_ALGID_HAVAL = CSSM_ALGID_NONE + 10;
1142	CSSM_ALGID_RIPEMD = CSSM_ALGID_NONE + 11;
1143	CSSM_ALGID_IBCHASH = CSSM_ALGID_NONE + 12;
1144	CSSM_ALGID_RIPEMAC = CSSM_ALGID_NONE + 13;
1145	CSSM_ALGID_DES = CSSM_ALGID_NONE + 14;
1146	CSSM_ALGID_DESX = CSSM_ALGID_NONE + 15;
1147	CSSM_ALGID_RDES = CSSM_ALGID_NONE + 16;
1148	CSSM_ALGID_3DES_3KEY_EDE = CSSM_ALGID_NONE + 17;
1149	CSSM_ALGID_3DES_2KEY_EDE = CSSM_ALGID_NONE + 18;
1150	CSSM_ALGID_3DES_1KEY_EEE = CSSM_ALGID_NONE + 19;
1151	CSSM_ALGID_3DES_3KEY = CSSM_ALGID_3DES_3KEY_EDE;
1152	CSSM_ALGID_3DES_3KEY_EEE = CSSM_ALGID_NONE + 20;
1153	CSSM_ALGID_3DES_2KEY = CSSM_ALGID_3DES_2KEY_EDE;
1154	CSSM_ALGID_3DES_2KEY_EEE = CSSM_ALGID_NONE + 21;
1155	CSSM_ALGID_3DES_1KEY = CSSM_ALGID_3DES_3KEY_EEE;
1156	CSSM_ALGID_IDEA = CSSM_ALGID_NONE + 22;
1157	CSSM_ALGID_RC2 = CSSM_ALGID_NONE + 23;
1158	CSSM_ALGID_RC5 = CSSM_ALGID_NONE + 24;
1159	CSSM_ALGID_RC4 = CSSM_ALGID_NONE + 25;
1160	CSSM_ALGID_SEAL = CSSM_ALGID_NONE + 26;
1161	CSSM_ALGID_CAST = CSSM_ALGID_NONE + 27;
1162	CSSM_ALGID_BLOWFISH = CSSM_ALGID_NONE + 28;
1163	CSSM_ALGID_SKIPJACK = CSSM_ALGID_NONE + 29;
1164	CSSM_ALGID_LUCIFER = CSSM_ALGID_NONE + 30;
1165	CSSM_ALGID_MADRYGA = CSSM_ALGID_NONE + 31;
1166	CSSM_ALGID_FEAL = CSSM_ALGID_NONE + 32;
1167	CSSM_ALGID_REDOC = CSSM_ALGID_NONE + 33;
1168	CSSM_ALGID_REDOC3 = CSSM_ALGID_NONE + 34;
1169	CSSM_ALGID_LOKI = CSSM_ALGID_NONE + 35;
1170	CSSM_ALGID_KHUFU = CSSM_ALGID_NONE + 36;
1171	CSSM_ALGID_KHAFRE = CSSM_ALGID_NONE + 37;
1172	CSSM_ALGID_MMB = CSSM_ALGID_NONE + 38;
1173	CSSM_ALGID_GOST = CSSM_ALGID_NONE + 39;
1174	CSSM_ALGID_SAFER = CSSM_ALGID_NONE + 40;
1175	CSSM_ALGID_CRAB = CSSM_ALGID_NONE + 41;
1176	CSSM_ALGID_RSA = CSSM_ALGID_NONE + 42;
1177	CSSM_ALGID_DSA = CSSM_ALGID_NONE + 43;
1178	CSSM_ALGID_MD5WithRSA = CSSM_ALGID_NONE + 44;
1179	CSSM_ALGID_MD2WithRSA = CSSM_ALGID_NONE + 45;
1180	CSSM_ALGID_ElGamal = CSSM_ALGID_NONE + 46;
1181	CSSM_ALGID_MD2Random = CSSM_ALGID_NONE + 47;
1182	CSSM_ALGID_MD5Random = CSSM_ALGID_NONE + 48;
1183	CSSM_ALGID_SHARandom = CSSM_ALGID_NONE + 49;
1184	CSSM_ALGID_DESRandom = CSSM_ALGID_NONE + 50;
1185	CSSM_ALGID_SHA1WithRSA = CSSM_ALGID_NONE + 51;
1186	CSSM_ALGID_CDMF = CSSM_ALGID_NONE + 52;
1187	CSSM_ALGID_CAST3 = CSSM_ALGID_NONE + 53;
1188	CSSM_ALGID_CAST5 = CSSM_ALGID_NONE + 54;
1189	CSSM_ALGID_GenericSecret = CSSM_ALGID_NONE + 55;
1190	CSSM_ALGID_ConcatBaseAndKey = CSSM_ALGID_NONE + 56;
1191	CSSM_ALGID_ConcatKeyAndBase = CSSM_ALGID_NONE + 57;
1192	CSSM_ALGID_ConcatBaseAndData = CSSM_ALGID_NONE + 58;
1193	CSSM_ALGID_ConcatDataAndBase = CSSM_ALGID_NONE + 59;
1194	CSSM_ALGID_XORBaseAndData = CSSM_ALGID_NONE + 60;
1195	CSSM_ALGID_ExtractFromKey = CSSM_ALGID_NONE + 61;
1196	CSSM_ALGID_SSL3PreMasterGen = CSSM_ALGID_NONE + 62;
1197	CSSM_ALGID_SSL3MasterDerive = CSSM_ALGID_NONE + 63;
1198	CSSM_ALGID_SSL3KeyAndMacDerive = CSSM_ALGID_NONE + 64;
1199	CSSM_ALGID_SSL3MD5_MAC = CSSM_ALGID_NONE + 65;
1200	CSSM_ALGID_SSL3SHA1_MAC = CSSM_ALGID_NONE + 66;
1201	CSSM_ALGID_PKCS5_PBKDF1_MD5 = CSSM_ALGID_NONE + 67;
1202	CSSM_ALGID_PKCS5_PBKDF1_MD2 = CSSM_ALGID_NONE + 68;
1203	CSSM_ALGID_PKCS5_PBKDF1_SHA1 = CSSM_ALGID_NONE + 69;
1204	CSSM_ALGID_WrapLynks = CSSM_ALGID_NONE + 70;
1205	CSSM_ALGID_WrapSET_OAEP = CSSM_ALGID_NONE + 71;
1206	CSSM_ALGID_BATON = CSSM_ALGID_NONE + 72;
1207	CSSM_ALGID_ECDSA = CSSM_ALGID_NONE + 73;
1208	CSSM_ALGID_MAYFLY = CSSM_ALGID_NONE + 74;
1209	CSSM_ALGID_JUNIPER = CSSM_ALGID_NONE + 75;
1210	CSSM_ALGID_FASTHASH = CSSM_ALGID_NONE + 76;
1211	CSSM_ALGID_3DES = CSSM_ALGID_NONE + 77;
1212	CSSM_ALGID_SSL3MD5 = CSSM_ALGID_NONE + 78;
1213	CSSM_ALGID_SSL3SHA1 = CSSM_ALGID_NONE + 79;
1214	CSSM_ALGID_FortezzaTimestamp = CSSM_ALGID_NONE + 80;
1215	CSSM_ALGID_SHA1WithDSA = CSSM_ALGID_NONE + 81;
1216	CSSM_ALGID_SHA1WithECDSA = CSSM_ALGID_NONE + 82;
1217	CSSM_ALGID_DSA_BSAFE = CSSM_ALGID_NONE + 83;
1218	CSSM_ALGID_ECDH = CSSM_ALGID_NONE + 84;
1219	CSSM_ALGID_ECMQV = CSSM_ALGID_NONE + 85;
1220	CSSM_ALGID_PKCS12_SHA1_PBE = CSSM_ALGID_NONE + 86;
1221	CSSM_ALGID_ECNRA = CSSM_ALGID_NONE + 87;
1222	CSSM_ALGID_SHA1WithECNRA = CSSM_ALGID_NONE + 88;
1223	CSSM_ALGID_ECES = CSSM_ALGID_NONE + 89;
1224	CSSM_ALGID_ECAES = CSSM_ALGID_NONE + 90;
1225	CSSM_ALGID_SHA1HMAC = CSSM_ALGID_NONE + 91;
1226	CSSM_ALGID_FIPS186Random = CSSM_ALGID_NONE + 92;
1227	CSSM_ALGID_ECC = CSSM_ALGID_NONE + 93;
1228	CSSM_ALGID_MQV = CSSM_ALGID_NONE + 94;
1229	CSSM_ALGID_NRA = CSSM_ALGID_NONE + 95;
1230	CSSM_ALGID_IntelPlatformRandom = CSSM_ALGID_NONE + 96;
1231	CSSM_ALGID_UTC = CSSM_ALGID_NONE + 97;
1232	CSSM_ALGID_HAVAL3 = CSSM_ALGID_NONE + 98;
1233	CSSM_ALGID_HAVAL4 = CSSM_ALGID_NONE + 99;
1234	CSSM_ALGID_HAVAL5 = CSSM_ALGID_NONE + 100;
1235	CSSM_ALGID_TIGER = CSSM_ALGID_NONE + 101;
1236	CSSM_ALGID_MD5HMAC = CSSM_ALGID_NONE + 102;
1237	CSSM_ALGID_PKCS5_PBKDF2 = CSSM_ALGID_NONE + 103;
1238	CSSM_ALGID_RUNNING_COUNTER = CSSM_ALGID_NONE + 104;
1239	CSSM_ALGID_LAST = CSSM_ALGID_NONE + $7FFFFFFF;
1240{ All algorithms IDs that are vendor specific, and not
1241   part of the CSSM specification should be defined relative
1242   to CSSM_ALGID_VENDOR_DEFINED. }
1243	CSSM_ALGID_VENDOR_DEFINED = CSSM_ALGID_NONE + $80000000;
1244
1245type
1246	CSSM_ENCRYPT_MODE = UInt32;
1247const
1248	CSSM_ALGMODE_NONE = 0;
1249	CSSM_ALGMODE_CUSTOM = CSSM_ALGMODE_NONE + 1;
1250	CSSM_ALGMODE_ECB = CSSM_ALGMODE_NONE + 2;
1251	CSSM_ALGMODE_ECBPad = CSSM_ALGMODE_NONE + 3;
1252	CSSM_ALGMODE_CBC = CSSM_ALGMODE_NONE + 4;
1253	CSSM_ALGMODE_CBC_IV8 = CSSM_ALGMODE_NONE + 5;
1254	CSSM_ALGMODE_CBCPadIV8 = CSSM_ALGMODE_NONE + 6;
1255	CSSM_ALGMODE_CFB = CSSM_ALGMODE_NONE + 7;
1256	CSSM_ALGMODE_CFB_IV8 = CSSM_ALGMODE_NONE + 8;
1257	CSSM_ALGMODE_CFBPadIV8 = CSSM_ALGMODE_NONE + 9;
1258	CSSM_ALGMODE_OFB = CSSM_ALGMODE_NONE + 10;
1259	CSSM_ALGMODE_OFB_IV8 = CSSM_ALGMODE_NONE + 11;
1260	CSSM_ALGMODE_OFBPadIV8 = CSSM_ALGMODE_NONE + 12;
1261	CSSM_ALGMODE_COUNTER = CSSM_ALGMODE_NONE + 13;
1262	CSSM_ALGMODE_BC = CSSM_ALGMODE_NONE + 14;
1263	CSSM_ALGMODE_PCBC = CSSM_ALGMODE_NONE + 15;
1264	CSSM_ALGMODE_CBCC = CSSM_ALGMODE_NONE + 16;
1265	CSSM_ALGMODE_OFBNLF = CSSM_ALGMODE_NONE + 17;
1266	CSSM_ALGMODE_PBC = CSSM_ALGMODE_NONE + 18;
1267	CSSM_ALGMODE_PFB = CSSM_ALGMODE_NONE + 19;
1268	CSSM_ALGMODE_CBCPD = CSSM_ALGMODE_NONE + 20;
1269	CSSM_ALGMODE_PUBLIC_KEY = CSSM_ALGMODE_NONE + 21;
1270	CSSM_ALGMODE_PRIVATE_KEY = CSSM_ALGMODE_NONE + 22;
1271	CSSM_ALGMODE_SHUFFLE = CSSM_ALGMODE_NONE + 23;
1272	CSSM_ALGMODE_ECB64 = CSSM_ALGMODE_NONE + 24;
1273	CSSM_ALGMODE_CBC64 = CSSM_ALGMODE_NONE + 25;
1274	CSSM_ALGMODE_OFB64 = CSSM_ALGMODE_NONE + 26;
1275	CSSM_ALGMODE_CFB32 = CSSM_ALGMODE_NONE + 28;
1276	CSSM_ALGMODE_CFB16 = CSSM_ALGMODE_NONE + 29;
1277	CSSM_ALGMODE_CFB8 = CSSM_ALGMODE_NONE + 30;
1278	CSSM_ALGMODE_WRAP = CSSM_ALGMODE_NONE + 31;
1279	CSSM_ALGMODE_PRIVATE_WRAP = CSSM_ALGMODE_NONE + 32;
1280	CSSM_ALGMODE_RELAYX = CSSM_ALGMODE_NONE + 33;
1281	CSSM_ALGMODE_ECB128 = CSSM_ALGMODE_NONE + 34;
1282	CSSM_ALGMODE_ECB96 = CSSM_ALGMODE_NONE + 35;
1283	CSSM_ALGMODE_CBC128 = CSSM_ALGMODE_NONE + 36;
1284	CSSM_ALGMODE_OAEP_HASH = CSSM_ALGMODE_NONE + 37;
1285	CSSM_ALGMODE_PKCS1_EME_V15 = CSSM_ALGMODE_NONE + 38;
1286	CSSM_ALGMODE_PKCS1_EME_OAEP = CSSM_ALGMODE_NONE + 39;
1287	CSSM_ALGMODE_PKCS1_EMSA_V15 = CSSM_ALGMODE_NONE + 40;
1288	CSSM_ALGMODE_ISO_9796 = CSSM_ALGMODE_NONE + 41;
1289	CSSM_ALGMODE_X9_31 = CSSM_ALGMODE_NONE + 42;
1290	CSSM_ALGMODE_LAST = CSSM_ALGMODE_NONE + $7FFFFFFF;
1291{ All algorithms modes that are vendor specific, and
1292   not part of the CSSM specification should be defined
1293   relative to CSSM_ALGMODE_VENDOR_DEFINED. }
1294	CSSM_ALGMODE_VENDOR_DEFINED = CSSM_ALGMODE_NONE + $80000000;
1295
1296type
1297	CSSM_KEYHEADER_PTR = ^cssm_keyheader;
1298	CSSM_KEYHEADERPtr = ^cssm_keyheader;
1299	cssm_keyheader = record
1300		HeaderVersion: CSSM_HEADERVERSION; { Key header version }
1301		CspId: CSSM_GUID; { GUID of CSP generating the key }
1302		BlobType: CSSM_KEYBLOB_TYPE; { See BlobType enum }
1303		Format: CSSM_KEYBLOB_FORMAT; { Raw or Reference format }
1304		AlgorithmId: CSSM_ALGORITHMS; { Algorithm ID of key }
1305		KeyClass: CSSM_KEYCLASS; { Public/Private/Secret, etc. }
1306		LogicalKeySizeInBits: UInt32; { Logical key size in bits }
1307		KeyAttr: CSSM_KEYATTR_FLAGS; { Attribute flags }
1308		KeyUsage: CSSM_KEYUSE; { Key use flags }
1309		StartDate: CSSM_DATE; { Effective date of key }
1310		EndDate: CSSM_DATE; { Expiration date of key }
1311		WrapAlgorithmId: CSSM_ALGORITHMS; { == CSSM_ALGID_NONE if clear key }
1312		WrapMode: CSSM_ENCRYPT_MODE; { if alg supports multiple wrapping modes }
1313		Reserved: UInt32;
1314	end;
1315	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1316
1317type
1318	CSSM_KEY_PTR = ^cssm_key;
1319	CSSM_KEYPtr = ^cssm_key;
1320	cssm_key = record
1321		KeyHeader: CSSM_KEYHEADER; { Fixed length key header }
1322		KeyData: CSSM_DATA; { Variable length key data }
1323	end;
1324	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1325
1326type
1327	CSSM_WRAP_KEY = CSSM_KEY;
1328	CSSM_WRAP_KEY_PTR = ^CSSM_KEY;
1329	CSSM_WRAP_KEYPtr = ^CSSM_KEY;
1330
1331type
1332	CSSM_CSPTYPE = UInt32;
1333const
1334	CSSM_CSP_SOFTWARE = 1;
1335	CSSM_CSP_HARDWARE = CSSM_CSP_SOFTWARE + 1;
1336	CSSM_CSP_HYBRID = CSSM_CSP_SOFTWARE + 2;
1337
1338{ From DL. }
1339type
1340	CSSM_DL_DB_HANDLE_PTR = ^cssm_dl_db_handle;
1341	CSSM_DL_DB_HANDLEPtr = ^cssm_dl_db_handle;
1342	cssm_dl_db_handle = record
1343		DLHandle: CSSM_DL_HANDLE;
1344		DBHandle: CSSM_DB_HANDLE;
1345	end;
1346	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1347
1348type
1349	CSSM_CONTEXT_TYPE = UInt32;
1350const
1351	CSSM_ALGCLASS_NONE = 0;
1352	CSSM_ALGCLASS_CUSTOM = CSSM_ALGCLASS_NONE + 1;
1353	CSSM_ALGCLASS_SIGNATURE = CSSM_ALGCLASS_NONE + 2;
1354	CSSM_ALGCLASS_SYMMETRIC = CSSM_ALGCLASS_NONE + 3;
1355	CSSM_ALGCLASS_DIGEST = CSSM_ALGCLASS_NONE + 4;
1356	CSSM_ALGCLASS_RANDOMGEN = CSSM_ALGCLASS_NONE + 5;
1357	CSSM_ALGCLASS_UNIQUEGEN = CSSM_ALGCLASS_NONE + 6;
1358	CSSM_ALGCLASS_MAC = CSSM_ALGCLASS_NONE + 7;
1359	CSSM_ALGCLASS_ASYMMETRIC = CSSM_ALGCLASS_NONE + 8;
1360	CSSM_ALGCLASS_KEYGEN = CSSM_ALGCLASS_NONE + 9;
1361	CSSM_ALGCLASS_DERIVEKEY = CSSM_ALGCLASS_NONE + 10;
1362
1363{ Attribute data type tags }
1364const
1365	CSSM_ATTRIBUTE_DATA_NONE = $00000000;
1366	CSSM_ATTRIBUTE_DATA_UINT32 = $10000000;
1367	CSSM_ATTRIBUTE_DATA_CSSM_DATA = $20000000;
1368	CSSM_ATTRIBUTE_DATA_CRYPTO_DATA = $30000000;
1369	CSSM_ATTRIBUTE_DATA_KEY = $40000000;
1370	CSSM_ATTRIBUTE_DATA_STRING = $50000000;
1371	CSSM_ATTRIBUTE_DATA_DATE = $60000000;
1372	CSSM_ATTRIBUTE_DATA_RANGE = $70000000;
1373	CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS = $80000000;
1374	CSSM_ATTRIBUTE_DATA_VERSION = $01000000;
1375	CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE = $02000000;
1376	CSSM_ATTRIBUTE_DATA_KR_PROFILE = $03000000;
1377	CSSM_ATTRIBUTE_TYPE_MASK = $FF000000;
1378
1379type
1380	CSSM_ATTRIBUTE_TYPE = UInt32;
1381const
1382	CSSM_ATTRIBUTE_NONE = 0;
1383	CSSM_ATTRIBUTE_CUSTOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 1;
1384	CSSM_ATTRIBUTE_DESCRIPTION = CSSM_ATTRIBUTE_DATA_STRING or 2;
1385	CSSM_ATTRIBUTE_KEY = CSSM_ATTRIBUTE_DATA_KEY or 3;
1386	CSSM_ATTRIBUTE_INIT_VECTOR = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 4;
1387	CSSM_ATTRIBUTE_SALT = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 5;
1388	CSSM_ATTRIBUTE_PADDING = CSSM_ATTRIBUTE_DATA_UINT32 or 6;
1389	CSSM_ATTRIBUTE_RANDOM = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 7;
1390	CSSM_ATTRIBUTE_SEED = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA or 8;
1391	CSSM_ATTRIBUTE_PASSPHRASE = CSSM_ATTRIBUTE_DATA_CRYPTO_DATA or 9;
1392	CSSM_ATTRIBUTE_KEY_LENGTH = CSSM_ATTRIBUTE_DATA_UINT32 or 10;
1393	CSSM_ATTRIBUTE_KEY_LENGTH_RANGE = CSSM_ATTRIBUTE_DATA_RANGE or 11;
1394	CSSM_ATTRIBUTE_BLOCK_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 or 12;
1395	CSSM_ATTRIBUTE_OUTPUT_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 or 13;
1396	CSSM_ATTRIBUTE_ROUNDS = CSSM_ATTRIBUTE_DATA_UINT32 or 14;
1397	CSSM_ATTRIBUTE_IV_SIZE = CSSM_ATTRIBUTE_DATA_UINT32 or 15;
1398	CSSM_ATTRIBUTE_ALG_PARAMS = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 16;
1399	CSSM_ATTRIBUTE_LABEL = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 17;
1400	CSSM_ATTRIBUTE_KEY_TYPE = CSSM_ATTRIBUTE_DATA_UINT32 or 18;
1401	CSSM_ATTRIBUTE_MODE = CSSM_ATTRIBUTE_DATA_UINT32 or 19;
1402	CSSM_ATTRIBUTE_EFFECTIVE_BITS = CSSM_ATTRIBUTE_DATA_UINT32 or 20;
1403	CSSM_ATTRIBUTE_START_DATE = CSSM_ATTRIBUTE_DATA_DATE or 21;
1404	CSSM_ATTRIBUTE_END_DATE = CSSM_ATTRIBUTE_DATA_DATE or 22;
1405	CSSM_ATTRIBUTE_KEYUSAGE = CSSM_ATTRIBUTE_DATA_UINT32 or 23;
1406	CSSM_ATTRIBUTE_KEYATTR = CSSM_ATTRIBUTE_DATA_UINT32 or 24;
1407	CSSM_ATTRIBUTE_VERSION = CSSM_ATTRIBUTE_DATA_VERSION or 25;
1408	CSSM_ATTRIBUTE_PRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 26;
1409	CSSM_ATTRIBUTE_BASE = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 27;
1410	CSSM_ATTRIBUTE_SUBPRIME = CSSM_ATTRIBUTE_DATA_CSSM_DATA or 28;
1411	CSSM_ATTRIBUTE_ALG_ID = CSSM_ATTRIBUTE_DATA_UINT32 or 29;
1412	CSSM_ATTRIBUTE_ITERATION_COUNT = CSSM_ATTRIBUTE_DATA_UINT32 or 30;
1413	CSSM_ATTRIBUTE_ROUNDS_RANGE = CSSM_ATTRIBUTE_DATA_RANGE or 31;
1414	CSSM_ATTRIBUTE_KRPROFILE_LOCAL = CSSM_ATTRIBUTE_DATA_KR_PROFILE or 32;
1415	CSSM_ATTRIBUTE_KRPROFILE_REMOTE = CSSM_ATTRIBUTE_DATA_KR_PROFILE or 33;
1416	CSSM_ATTRIBUTE_CSP_HANDLE = CSSM_ATTRIBUTE_DATA_UINT32 or 34;
1417	CSSM_ATTRIBUTE_DL_DB_HANDLE = CSSM_ATTRIBUTE_DATA_DL_DB_HANDLE or 35;
1418	CSSM_ATTRIBUTE_ACCESS_CREDENTIALS = CSSM_ATTRIBUTE_DATA_ACCESS_CREDENTIALS or 36;
1419	CSSM_ATTRIBUTE_PUBLIC_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 or 37;
1420	CSSM_ATTRIBUTE_PRIVATE_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 or 38;
1421	CSSM_ATTRIBUTE_SYMMETRIC_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 or 39;
1422	CSSM_ATTRIBUTE_WRAPPED_KEY_FORMAT = CSSM_ATTRIBUTE_DATA_UINT32 or 40;
1423
1424type
1425	CSSM_PADDING = UInt32;
1426const
1427	CSSM_PADDING_NONE = 0;
1428	CSSM_PADDING_CUSTOM = CSSM_PADDING_NONE + 1;
1429	CSSM_PADDING_ZERO = CSSM_PADDING_NONE + 2;
1430	CSSM_PADDING_ONE = CSSM_PADDING_NONE + 3;
1431	CSSM_PADDING_ALTERNATE = CSSM_PADDING_NONE + 4;
1432	CSSM_PADDING_FF = CSSM_PADDING_NONE + 5;
1433	CSSM_PADDING_PKCS5 = CSSM_PADDING_NONE + 6;
1434	CSSM_PADDING_PKCS7 = CSSM_PADDING_NONE + 7;
1435	CSSM_PADDING_CIPHERSTEALING = CSSM_PADDING_NONE + 8;
1436	CSSM_PADDING_RANDOM = CSSM_PADDING_NONE + 9;
1437	CSSM_PADDING_PKCS1 = CSSM_PADDING_NONE + 10;
1438{ All padding types that are vendor specific, and not
1439   part of the CSSM specification should be defined
1440   relative to CSSM_PADDING_VENDOR_DEFINED. }
1441	CSSM_PADDING_VENDOR_DEFINED = CSSM_PADDING_NONE + $80000000;
1442
1443type
1444	CSSM_KEY_TYPE = CSSM_ALGORITHMS;
1445
1446type
1447  __embedded_cssm_context_attribute = record
1448		case Integer of
1449		  0: (String_: CStringPtr);
1450		  1: (Uint32: UInt32_fix);
1451  		2: (AccessCredentials: CSSM_ACCESS_CREDENTIALS_PTR);
1452		  3: (Key: CSSM_KEY_PTR);
1453		  4: (Data: CSSM_DATA_PTR);
1454		  5: (Padding: CSSM_PADDING);
1455		  6: (Date: CSSM_DATE_PTR);
1456		  7: (Range: CSSM_RANGE_PTR);
1457		  8: (CryptoData: CSSM_CRYPTO_DATA_PTR);
1458  		9: (Version: CSSM_VERSION_PTR);
1459		  10: (DLDBHandle: CSSM_DL_DB_HANDLE_PTR);
1460  		11: (KRProfile: UnivPtr {cssm_kr_profile_ptr});
1461  end;
1462  
1463  CSSM_CONTEXT_ATTRIBUTE_PTR = ^cssm_context_attribute;
1464  CSSM_CONTEXT_ATTRIBUTEPtr = ^cssm_context_attribute;
1465	cssm_context_attribute = record
1466		AttributeType: CSSM_ATTRIBUTE_TYPE;
1467		AttributeLength: UInt32;
1468		Attribute: __embedded_cssm_context_attribute;
1469	end;
1470
1471type
1472	CSSM_CONTEXT_PTR = ^cssm_context;
1473	CSSM_CONTEXTPtr = ^cssm_context;
1474	cssm_context = record
1475		ContextType: CSSM_CONTEXT_TYPE;
1476		AlgorithmType: CSSM_ALGORITHMS;
1477		NumberOfAttributes: UInt32;
1478		ContextAttributes: CSSM_CONTEXT_ATTRIBUTE_PTR;
1479		CSPHandle: CSSM_CSP_HANDLE;
1480		Privileged: CSSM_BOOL;
1481	  EncryptionProhibited: uint32 {CSSM_KR_POLICY_FLAGS} ;
1482		WorkFactor: UInt32;
1483		Reserved: UInt32;	{ reserved for future use }
1484	end;
1485	(* DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER *)
1486
1487type
1488	CSSM_SC_FLAGS = UInt32;
1489const
1490	CSSM_CSP_TOK_RNG = $00000001;
1491	CSSM_CSP_TOK_CLOCK_EXISTS = $00000040;
1492
1493type
1494	CSSM_CSP_READER_FLAGS = UInt32;
1495const
1496	CSSM_CSP_RDR_TOKENPRESENT = $00000001;
1497	{ Token is present in reader/slot }
1498	CSSM_CSP_RDR_EXISTS = $00000002;
1499	{ Device is a reader with a
1500	   removable token }
1501	CSSM_CSP_RDR_HW = $00000004;
1502	{ Slot is a hardware slot }
1503
1504type
1505	CSSM_CSP_FLAGS = UInt32;
1506const
1507	CSSM_CSP_TOK_WRITE_PROTECTED = $00000002;
1508	CSSM_CSP_TOK_LOGIN_REQUIRED = $00000004;
1509	CSSM_CSP_TOK_USER_PIN_INITIALIZED = $00000008;
1510	CSSM_CSP_TOK_PROT_AUTHENTICATION = $00000100;
1511	CSSM_CSP_TOK_USER_PIN_EXPIRED = $00100000;
1512	CSSM_CSP_TOK_SESSION_KEY_PASSWORD = $00200000;
1513	CSSM_CSP_TOK_PRIVATE_KEY_PASSWORD = $00400000;
1514	CSSM_CSP_STORES_PRIVATE_KEYS = $01000000;
1515	CSSM_CSP_STORES_PUBLIC_KEYS = $02000000;
1516	CSSM_CSP_STORES_SESSION_KEYS = $04000000;
1517	CSSM_CSP_STORES_CERTIFICATES = $08000000;
1518	CSSM…

Large files files are truncated, but you can click here to view the full file