CSIdentity.pas 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630
  1. {
  2. File: OSServices/CSIdentity.h
  3. Contains: CSIdentity APIs
  4. Version: OSServices-352~2
  5. Copyright: © 2006-2008 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  11. {
  12. Modified for use with Free Pascal
  13. Version 308
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  17. {$mode macpas}
  18. {$packenum 1}
  19. {$macro on}
  20. {$inline on}
  21. {$calling mwpascal}
  22. unit CSIdentity;
  23. interface
  24. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  25. {$setc GAP_INTERFACES_VERSION := $0308}
  26. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  27. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  28. {$endc}
  29. {$ifc defined CPUPOWERPC and defined CPUI386}
  30. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  31. {$endc}
  32. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  33. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  34. {$endc}
  35. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  36. {$setc __ppc__ := 1}
  37. {$elsec}
  38. {$setc __ppc__ := 0}
  39. {$endc}
  40. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  41. {$setc __ppc64__ := 1}
  42. {$elsec}
  43. {$setc __ppc64__ := 0}
  44. {$endc}
  45. {$ifc not defined __i386__ and defined CPUI386}
  46. {$setc __i386__ := 1}
  47. {$elsec}
  48. {$setc __i386__ := 0}
  49. {$endc}
  50. {$ifc not defined __x86_64__ and defined CPUX86_64}
  51. {$setc __x86_64__ := 1}
  52. {$elsec}
  53. {$setc __x86_64__ := 0}
  54. {$endc}
  55. {$ifc not defined __arm__ and defined CPUARM}
  56. {$setc __arm__ := 1}
  57. {$elsec}
  58. {$setc __arm__ := 0}
  59. {$endc}
  60. {$ifc defined cpu64}
  61. {$setc __LP64__ := 1}
  62. {$elsec}
  63. {$setc __LP64__ := 0}
  64. {$endc}
  65. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  66. {$error Conflicting definitions for __ppc__ and __i386__}
  67. {$endc}
  68. {$ifc defined __ppc__ and __ppc__}
  69. {$setc TARGET_CPU_PPC := TRUE}
  70. {$setc TARGET_CPU_PPC64 := FALSE}
  71. {$setc TARGET_CPU_X86 := FALSE}
  72. {$setc TARGET_CPU_X86_64 := FALSE}
  73. {$setc TARGET_CPU_ARM := FALSE}
  74. {$setc TARGET_OS_MAC := TRUE}
  75. {$setc TARGET_OS_IPHONE := FALSE}
  76. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  77. {$elifc defined __ppc64__ and __ppc64__}
  78. {$setc TARGET_CPU_PPC := FALSE}
  79. {$setc TARGET_CPU_PPC64 := TRUE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$elifc defined __i386__ and __i386__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := FALSE}
  89. {$setc TARGET_CPU_X86 := TRUE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$ifc defined(iphonesim)}
  93. {$setc TARGET_OS_MAC := FALSE}
  94. {$setc TARGET_OS_IPHONE := TRUE}
  95. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  96. {$elsec}
  97. {$setc TARGET_OS_MAC := TRUE}
  98. {$setc TARGET_OS_IPHONE := FALSE}
  99. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  100. {$endc}
  101. {$elifc defined __x86_64__ and __x86_64__}
  102. {$setc TARGET_CPU_PPC := FALSE}
  103. {$setc TARGET_CPU_PPC64 := FALSE}
  104. {$setc TARGET_CPU_X86 := FALSE}
  105. {$setc TARGET_CPU_X86_64 := TRUE}
  106. {$setc TARGET_CPU_ARM := FALSE}
  107. {$setc TARGET_OS_MAC := TRUE}
  108. {$setc TARGET_OS_IPHONE := FALSE}
  109. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  110. {$elifc defined __arm__ and __arm__}
  111. {$setc TARGET_CPU_PPC := FALSE}
  112. {$setc TARGET_CPU_PPC64 := FALSE}
  113. {$setc TARGET_CPU_X86 := FALSE}
  114. {$setc TARGET_CPU_X86_64 := FALSE}
  115. {$setc TARGET_CPU_ARM := TRUE}
  116. { will require compiler define when/if other Apple devices with ARM cpus ship }
  117. {$setc TARGET_OS_MAC := FALSE}
  118. {$setc TARGET_OS_IPHONE := TRUE}
  119. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  120. {$elsec}
  121. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  122. {$endc}
  123. {$ifc defined __LP64__ and __LP64__ }
  124. {$setc TARGET_CPU_64 := TRUE}
  125. {$elsec}
  126. {$setc TARGET_CPU_64 := FALSE}
  127. {$endc}
  128. {$ifc defined FPC_BIG_ENDIAN}
  129. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  130. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  131. {$elifc defined FPC_LITTLE_ENDIAN}
  132. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  133. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  134. {$elsec}
  135. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  136. {$endc}
  137. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  138. {$setc CALL_NOT_IN_CARBON := FALSE}
  139. {$setc OLDROUTINENAMES := FALSE}
  140. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  141. {$setc OPAQUE_UPP_TYPES := TRUE}
  142. {$setc OTCARBONAPPLICATION := TRUE}
  143. {$setc OTKERNEL := FALSE}
  144. {$setc PM_USE_SESSION_APIS := TRUE}
  145. {$setc TARGET_API_MAC_CARBON := TRUE}
  146. {$setc TARGET_API_MAC_OS8 := FALSE}
  147. {$setc TARGET_API_MAC_OSX := TRUE}
  148. {$setc TARGET_CARBON := TRUE}
  149. {$setc TARGET_CPU_68K := FALSE}
  150. {$setc TARGET_CPU_MIPS := FALSE}
  151. {$setc TARGET_CPU_SPARC := FALSE}
  152. {$setc TARGET_OS_UNIX := FALSE}
  153. {$setc TARGET_OS_WIN32 := FALSE}
  154. {$setc TARGET_RT_MAC_68881 := FALSE}
  155. {$setc TARGET_RT_MAC_CFM := FALSE}
  156. {$setc TARGET_RT_MAC_MACHO := TRUE}
  157. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  158. {$setc TYPE_BOOL := FALSE}
  159. {$setc TYPE_EXTENDED := FALSE}
  160. {$setc TYPE_LONGLONG := TRUE}
  161. uses MacTypes,MacOSXPosix,CSIdentityAuthority,SecBase,Authorization,CFBase,CFArray,CFData,CFError,CFRunLoop,CFUUID;
  162. {$endc} {not MACOSALLINCLUDE}
  163. {$ifc TARGET_OS_MAC}
  164. {$ALIGN MAC68K}
  165. {
  166. The error domain of all CFErrors reported by Identity Services
  167. }
  168. {
  169. * kCSIdentityErrorDomain
  170. *
  171. * Availability:
  172. * Mac OS X: in version 10.5 and later in CoreServices.framework
  173. * CarbonLib: not available
  174. * Non-Carbon CFM: not available
  175. }
  176. var kCSIdentityErrorDomain: CFStringRef; external name '_kCSIdentityErrorDomain'; (* attribute const *)
  177. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  178. {
  179. * CSIdentity error codes
  180. *
  181. * Discussion:
  182. * Error codes in the CSIdentity error domain
  183. }
  184. const
  185. {
  186. * The specified authority is not recognized
  187. }
  188. kCSIdentityUnknownAuthorityErr = -1;
  189. {
  190. * The specified authority is currently not accessible
  191. }
  192. kCSIdentityAuthorityNotAccessibleErr = -2;
  193. {
  194. * The caller does not have permission to perform the operation
  195. }
  196. kCSIdentityPermissionErr = -3;
  197. {
  198. * The requested identity has been deteled
  199. }
  200. kCSIdentityDeletedErr = -4;
  201. {
  202. * The full name is not valid (length: [1-255])
  203. }
  204. kCSIdentityInvalidFullNameErr = -5;
  205. {
  206. * The full name is aleady assigned to another identity
  207. }
  208. kCSIdentityDuplicateFullNameErr = -6;
  209. {
  210. * The Posix name is not valid (char set: [a-zA-Z0-9_-] length:
  211. * [1-255])
  212. }
  213. kCSIdentityInvalidPosixNameErr = -7;
  214. {
  215. * The Posix name is aleady assigned to another identity
  216. }
  217. kCSIdentityDuplicatePosixNameErr = -8;
  218. {
  219. CSIdentity
  220. A CSIdentity object represents a user or group entity known to the system. An
  221. identity object has the following required attributes: a class (user
  222. or group), a unique identitfier (UUID), a full name, a Posix ID
  223. (UID or GID), and a Posix name (a.k.a. "short" name). There are also a number
  224. of optional attributes such as email address, image data, etc.
  225. Group identities have a membership which may include both users as well as
  226. other groups. An identity can be tested for membership in a specific group.
  227. A CSIdentity object is a private copy of the identity information. It can be
  228. modified in memory, but requires authorization to commit changes back to
  229. the identity authority database. On Mac OS X version 10.5, only local identities
  230. can be created, modified or deleted, and only by users with Administrator
  231. credentials.
  232. Changes may be committed synchronously or asynchronously. All data validation
  233. occurs at commit time.
  234. Two identities are CFEqual if they have the same class and UUID.
  235. }
  236. {
  237. * CSIdentityRef
  238. *
  239. * Discussion:
  240. * A reference to an identity object. Can be either a user or group.
  241. }
  242. type
  243. CSIdentityRef = ^__CSIdentity; { an opaque type }
  244. __CSIdentity = record end;
  245. {
  246. * CSIdentityQueryRef
  247. *
  248. * Discussion:
  249. * A reference to an identity query object, used to lookup
  250. * identities in an identity authority's database.
  251. }
  252. type
  253. CSIdentityQueryRef = ^__CSIdentityQuery; { an opaque type }
  254. __CSIdentityQuery = record end;
  255. {
  256. kCSIdentityGeneratePosixName
  257. Passing this constant as the Posix name when creating an indentity
  258. will generate a unique Posix name, based on the full name. The Posix
  259. name is generated at commit time.
  260. }
  261. {
  262. * kCSIdentityGeneratePosixName
  263. *
  264. * Availability:
  265. * Mac OS X: in version 10.5 and later in CoreServices.framework
  266. * CarbonLib: not available
  267. * Non-Carbon CFM: not available
  268. }
  269. var kCSIdentityGeneratePosixName: CFStringRef; external name '_kCSIdentityGeneratePosixName'; (* attribute const *)
  270. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  271. {
  272. * CSIdentityClass
  273. *
  274. * Discussion:
  275. * Enum specifying an identity class
  276. }
  277. const
  278. {
  279. * The class value for user identities
  280. }
  281. kCSIdentityClassUser = 1;
  282. {
  283. * The class value for group identities
  284. }
  285. kCSIdentityClassGroup = 2;
  286. type
  287. CSIdentityClass = CFIndex;
  288. {
  289. * CSIdentityFlags
  290. *
  291. * Discussion:
  292. * Flags used when creating new identities
  293. }
  294. const
  295. {
  296. * Use this flag to set no optional attributes for a new identity
  297. }
  298. kCSIdentityFlagNone = 0;
  299. {
  300. * This flag causes the identity to be "hidden," that is, excluded
  301. * from most user-visible identity lists. Hidden identities include
  302. * administrative users and groups such as root, www, and mysql.
  303. * System service access control groups should be created with the
  304. * hidden flag.
  305. }
  306. kCSIdentityFlagHidden = 1;
  307. type
  308. CSIdentityFlags = CFOptionFlags;
  309. {
  310. * CSIdentityGetTypeID()
  311. *
  312. * Summary:
  313. * Returns the CSIdentity type identifier
  314. *
  315. * Mac OS X threading:
  316. * Thread safe since version 10.5
  317. *
  318. * Result:
  319. * The CFTypeID of the CSIdentity Core Foundation type
  320. *
  321. * Availability:
  322. * Mac OS X: in version 10.5 and later in CoreServices.framework
  323. * CarbonLib: not available
  324. * Non-Carbon CFM: not available
  325. }
  326. function CSIdentityGetTypeID: CFTypeID; external name '_CSIdentityGetTypeID';
  327. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  328. {
  329. *
  330. * Creating Identities
  331. *
  332. }
  333. {
  334. * CSIdentityCreate()
  335. *
  336. * Summary:
  337. * Creates a new identity
  338. *
  339. * Discussion:
  340. * The new identity is allocated but is not committed to the
  341. * identity authority's database. It will become persistent and
  342. * available to other clients after being committed using
  343. * CSIdentityCommit or CSIdentityCommitAsynchronously.
  344. *
  345. * Mac OS X threading:
  346. * Thread safe since version 10.5
  347. *
  348. * Parameters:
  349. *
  350. * allocator:
  351. * The allocator to use when creating the object. NULL is
  352. * equivalent to specifying kCFAllocatorDefault.
  353. *
  354. * identityClass:
  355. * The type of identity to be created. Specifying
  356. * kCSIdentityClassUser creates a user, while
  357. * kCSIdentityClassGroup creates a group.
  358. *
  359. * fullName:
  360. * The primary name of the new identity.
  361. *
  362. * posixName:
  363. * The POSIX name of the new identity. Specify
  364. * kCSIdentityGeneratePosixName to have a name generated
  365. * autmatically from the full name.
  366. *
  367. * flags:
  368. * A CSIdentityFlags mask defining attributes of the new identity
  369. *
  370. * authority:
  371. * The identity authority to host the identity. Caller must have
  372. * write access to the identity authority or commit will fail.
  373. * Currently, only local identities may be created, so callers
  374. * must specify the local identity authority for this argument.
  375. *
  376. * Result:
  377. * The CSIdentityRef of the newly created identity object. Returns
  378. * NULL only if allocation fails.
  379. *
  380. * Availability:
  381. * Mac OS X: in version 10.5 and later in CoreServices.framework
  382. * CarbonLib: not available
  383. * Non-Carbon CFM: not available
  384. }
  385. function CSIdentityCreate( allocator: CFAllocatorRef; identityClass: CSIdentityClass; fullName: CFStringRef; posixName: CFStringRef; flags: CSIdentityFlags; authority: CSIdentityAuthorityRef ): CSIdentityRef; external name '_CSIdentityCreate';
  386. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  387. {
  388. * CSIdentityCreateCopy()
  389. *
  390. * Summary:
  391. * Creates a copy of an identity
  392. *
  393. * Mac OS X threading:
  394. * Thread safe since version 10.5
  395. *
  396. * Parameters:
  397. *
  398. * allocator:
  399. * The allocator to use for the new identity. NULL is equivalent
  400. * to specifying kCFAllocatorDefault.
  401. *
  402. * identity:
  403. * The identity to copy
  404. *
  405. * Result:
  406. * The CSIdentityRef of the newly created identity object
  407. *
  408. * Availability:
  409. * Mac OS X: in version 10.5 and later in CoreServices.framework
  410. * CarbonLib: not available
  411. * Non-Carbon CFM: not available
  412. }
  413. function CSIdentityCreateCopy( allocator: CFAllocatorRef; identity: CSIdentityRef ): CSIdentityRef; external name '_CSIdentityCreateCopy';
  414. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  415. {
  416. *
  417. * Getting Identity Attributes
  418. *
  419. }
  420. {
  421. * CSIdentityGetClass()
  422. *
  423. * Summary:
  424. * Returns an identity's class
  425. *
  426. * Mac OS X threading:
  427. * Thread safe since version 10.5
  428. *
  429. * Parameters:
  430. *
  431. * identity:
  432. * The identity object to access
  433. *
  434. * Result:
  435. * The CSIdentityClass of an identity
  436. *
  437. * Availability:
  438. * Mac OS X: in version 10.5 and later in CoreServices.framework
  439. * CarbonLib: not available
  440. * Non-Carbon CFM: not available
  441. }
  442. function CSIdentityGetClass( identity: CSIdentityRef ): CSIdentityClass; external name '_CSIdentityGetClass';
  443. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  444. {
  445. * CSIdentityGetAuthority()
  446. *
  447. * Summary:
  448. * Returns the identity authority of an identity
  449. *
  450. * Mac OS X threading:
  451. * Thread safe since version 10.5
  452. *
  453. * Parameters:
  454. *
  455. * identity:
  456. * The identity object to access
  457. *
  458. * Result:
  459. * A CSIdentityAuthorityRef object
  460. *
  461. * Availability:
  462. * Mac OS X: in version 10.5 and later in CoreServices.framework
  463. * CarbonLib: not available
  464. * Non-Carbon CFM: not available
  465. }
  466. function CSIdentityGetAuthority( identity: CSIdentityRef ): CSIdentityAuthorityRef; external name '_CSIdentityGetAuthority';
  467. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  468. {
  469. * CSIdentityGetUUID()
  470. *
  471. * Summary:
  472. * Returns an identity's UUID.
  473. *
  474. * Mac OS X threading:
  475. * Thread safe since version 10.5
  476. *
  477. * Parameters:
  478. *
  479. * identity:
  480. * The identity object to access
  481. *
  482. * Result:
  483. * A CFUUID object containing identity's UUID. Will never return
  484. * NULL.
  485. *
  486. * Availability:
  487. * Mac OS X: in version 10.5 and later in CoreServices.framework
  488. * CarbonLib: not available
  489. * Non-Carbon CFM: not available
  490. }
  491. function CSIdentityGetUUID( identity: CSIdentityRef ): CFUUIDRef; external name '_CSIdentityGetUUID';
  492. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  493. {
  494. * CSIdentityGetFullName()
  495. *
  496. * Summary:
  497. * Retrieve the full name of an identity
  498. *
  499. * Discussion:
  500. * The full name is the name that is displayed in the user interface.
  501. *
  502. * Mac OS X threading:
  503. * Thread safe since version 10.5
  504. *
  505. * Parameters:
  506. *
  507. * identity:
  508. * The identity object to access
  509. *
  510. * Result:
  511. * Returns an identity's full name as a CFStringRef. This attribute
  512. * is always non-NULL. The identity object may release its reference
  513. * to the return value when the identity is modified.
  514. *
  515. * Availability:
  516. * Mac OS X: in version 10.5 and later in CoreServices.framework
  517. * CarbonLib: not available
  518. * Non-Carbon CFM: not available
  519. }
  520. function CSIdentityGetFullName( identity: CSIdentityRef ): CFStringRef; external name '_CSIdentityGetFullName';
  521. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  522. {
  523. * CSIdentityGetPosixID()
  524. *
  525. * Summary:
  526. * Retrieve POSIX ID of an identity.
  527. *
  528. * Mac OS X threading:
  529. * Thread safe since version 10.5
  530. *
  531. * Parameters:
  532. *
  533. * identity:
  534. * The identity to access
  535. *
  536. * Result:
  537. * Returns an identity's POSIX identifier (a UID or GID).
  538. *
  539. * Availability:
  540. * Mac OS X: in version 10.5 and later in CoreServices.framework
  541. * CarbonLib: not available
  542. * Non-Carbon CFM: not available
  543. }
  544. function CSIdentityGetPosixID( identity: CSIdentityRef ): id_t; external name '_CSIdentityGetPosixID';
  545. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  546. {
  547. * CSIdentityGetPosixName()
  548. *
  549. * Summary:
  550. * Retrieve the POSIX name (short name) of an identity.
  551. *
  552. * Discussion:
  553. * The POSIX name cannot be changed after an identity has been
  554. * created.
  555. *
  556. * Mac OS X threading:
  557. * Thread safe since version 10.5
  558. *
  559. * Parameters:
  560. *
  561. * identity:
  562. * The identity object to access.
  563. *
  564. * Result:
  565. * Returns an identity's POSIX name. This attribute is always
  566. * non-NULL. The identity object may release its reference to the
  567. * return value when the identity is modified.
  568. *
  569. * Availability:
  570. * Mac OS X: in version 10.5 and later in CoreServices.framework
  571. * CarbonLib: not available
  572. * Non-Carbon CFM: not available
  573. }
  574. function CSIdentityGetPosixName( identity: CSIdentityRef ): CFStringRef; external name '_CSIdentityGetPosixName';
  575. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  576. {
  577. * CSIdentityGetEmailAddress()
  578. *
  579. * Summary:
  580. * Retrieve the email address of a user identity
  581. *
  582. * Mac OS X threading:
  583. * Thread safe since version 10.5
  584. *
  585. * Parameters:
  586. *
  587. * identity:
  588. * The identity to access
  589. *
  590. * Result:
  591. * Returns the email address of the identity or NULL if there is no
  592. * email address. The identity object may release its reference to
  593. * the return value when the identity is modified.
  594. *
  595. * Availability:
  596. * Mac OS X: in version 10.5 and later in CoreServices.framework
  597. * CarbonLib: not available
  598. * Non-Carbon CFM: not available
  599. }
  600. function CSIdentityGetEmailAddress( identity: CSIdentityRef ): CFStringRef; external name '_CSIdentityGetEmailAddress';
  601. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  602. {
  603. * CSIdentityGetImageURL()
  604. *
  605. * Summary:
  606. * Retrieve the URL to an identity's image file
  607. *
  608. * Mac OS X threading:
  609. * Thread safe since version 10.5
  610. *
  611. * Parameters:
  612. *
  613. * identity:
  614. * The identity to access
  615. *
  616. * Result:
  617. * Returns a CFURLRef that contains the location of the user's image
  618. * file, or NULL if there is no image URL. The identity object may
  619. * release its reference to the return value when the identity is
  620. * modified.
  621. *
  622. * Availability:
  623. * Mac OS X: in version 10.5 and later in CoreServices.framework
  624. * CarbonLib: not available
  625. * Non-Carbon CFM: not available
  626. }
  627. function CSIdentityGetImageURL( identity: CSIdentityRef ): CFURLRef; external name '_CSIdentityGetImageURL';
  628. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  629. {
  630. * CSIdentityGetImageData()
  631. *
  632. * Summary:
  633. * Retrieve the image associated with a user identity
  634. *
  635. * Mac OS X threading:
  636. * Thread safe since version 10.5
  637. *
  638. * Parameters:
  639. *
  640. * identity:
  641. * The identity to access
  642. *
  643. * Result:
  644. * Returns the identity's image data as a CFDataRef or NULL if there
  645. * is no image data. The identity object may release its reference
  646. * to the return value when the identity is modified.
  647. *
  648. * Availability:
  649. * Mac OS X: in version 10.5 and later in CoreServices.framework
  650. * CarbonLib: not available
  651. * Non-Carbon CFM: not available
  652. }
  653. function CSIdentityGetImageData( identity: CSIdentityRef ): CFDataRef; external name '_CSIdentityGetImageData';
  654. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  655. {
  656. * CSIdentityGetImageDataType()
  657. *
  658. * Summary:
  659. * Retrieve the uniform type identifier (UTI) of an identity's image
  660. *
  661. * Mac OS X threading:
  662. * Thread safe since version 10.5
  663. *
  664. * Parameters:
  665. *
  666. * identity:
  667. * The identity to access
  668. *
  669. * Result:
  670. * Returns a UTI as a CFStringRef for this identity's image data or
  671. * NULL if there is no image data. The identity object may release
  672. * its reference to the return value when the identity is modified.
  673. *
  674. * Availability:
  675. * Mac OS X: in version 10.5 and later in CoreServices.framework
  676. * CarbonLib: not available
  677. * Non-Carbon CFM: not available
  678. }
  679. function CSIdentityGetImageDataType( identity: CSIdentityRef ): CFStringRef; external name '_CSIdentityGetImageDataType';
  680. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  681. {
  682. * CSIdentityGetAliases()
  683. *
  684. * Summary:
  685. * Retrieve the aliases of an identity.
  686. *
  687. * Discussion:
  688. * Aliases are alternate names for identities. As with all identity
  689. * names, aliases must be unique within the entire namespace of of
  690. * the identity authority.
  691. *
  692. * Mac OS X threading:
  693. * Thread safe since version 10.5
  694. *
  695. * Parameters:
  696. *
  697. * identity:
  698. * The identity to access
  699. *
  700. * Result:
  701. * Returns an array containing the identity's name aliases as
  702. * CFStringRefs. The array may be empty. The identity object may
  703. * release its reference to the return value when the identity is
  704. * modified.
  705. *
  706. * Availability:
  707. * Mac OS X: in version 10.5 and later in CoreServices.framework
  708. * CarbonLib: not available
  709. * Non-Carbon CFM: not available
  710. }
  711. function CSIdentityGetAliases( identity: CSIdentityRef ): CFArrayRef; external name '_CSIdentityGetAliases';
  712. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  713. {
  714. * CSIdentityIsMemberOfGroup()
  715. *
  716. * Summary:
  717. * Check if an identity is a memeber of a group
  718. *
  719. * Mac OS X threading:
  720. * Thread safe since version 10.5
  721. *
  722. * Parameters:
  723. *
  724. * identity:
  725. * The identity whose membership is in question
  726. *
  727. * group:
  728. * The group identity whose membership is to be checked
  729. *
  730. * Result:
  731. * Returns true if the identity is a member (directly or indirectly)
  732. * of the specified group
  733. *
  734. * Availability:
  735. * Mac OS X: in version 10.5 and later in CoreServices.framework
  736. * CarbonLib: not available
  737. * Non-Carbon CFM: not available
  738. }
  739. function CSIdentityIsMemberOfGroup( identity: CSIdentityRef; group: CSIdentityRef ): Boolean; external name '_CSIdentityIsMemberOfGroup';
  740. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  741. {
  742. * CSIdentityIsHidden()
  743. *
  744. * Summary:
  745. * Determine if a identity's hidden attribute is enabled
  746. *
  747. * Mac OS X threading:
  748. * Thread safe since version 10.5
  749. *
  750. * Parameters:
  751. *
  752. * identity:
  753. * The identity object to access
  754. *
  755. * Result:
  756. * Returns true if the identity was created with the hidden attribute
  757. *
  758. * Availability:
  759. * Mac OS X: in version 10.5 and later in CoreServices.framework
  760. * CarbonLib: not available
  761. * Non-Carbon CFM: not available
  762. }
  763. function CSIdentityIsHidden( identity: CSIdentityRef ): Boolean; external name '_CSIdentityIsHidden';
  764. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  765. {
  766. * CSIdentityCreatePersistentReference()
  767. *
  768. * Summary:
  769. * Create an opaque, persistent data reference to an identity
  770. *
  771. * Discussion:
  772. * A persistent identity reference is an opaque data object from
  773. * which an identity object may queried the future (see
  774. * CSIdentityQueryCreateForPersistentReference). A persistent
  775. * reference is suitable for storage in an external data store, for
  776. * example, as an entry in an application-specific access control
  777. * list associated with a shared resource. Use of a persistent
  778. * identity reference is preferred over a pure UUID-based identity
  779. * reference because the peristent reference contains additional
  780. * information needed to optimize the identity query and to improve
  781. * the user experience when working in a distributed identity
  782. * environment (LDAP, Active Directory, etc.).
  783. *
  784. * Mac OS X threading:
  785. * Thread safe since version 10.5
  786. *
  787. * Parameters:
  788. *
  789. * allocator:
  790. * The allocator for the data
  791. *
  792. * identity:
  793. * The identity to reference
  794. *
  795. * Result:
  796. * Returns a new persistent reference for the identity
  797. *
  798. * Availability:
  799. * Mac OS X: in version 10.5 and later in CoreServices.framework
  800. * CarbonLib: not available
  801. * Non-Carbon CFM: not available
  802. }
  803. function CSIdentityCreatePersistentReference( allocator: CFAllocatorRef; identity: CSIdentityRef ): CFDataRef; external name '_CSIdentityCreatePersistentReference';
  804. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  805. {
  806. *
  807. * Methods which apply only to users
  808. *
  809. }
  810. {
  811. * CSIdentityIsEnabled()
  812. *
  813. * Summary:
  814. * Determine if a user is enabled
  815. *
  816. * Discussion:
  817. * A user that is not enabled cannot authenticate. This setting may
  818. * be used to temporarily allow a user's access to all services and
  819. * resources.
  820. *
  821. * Mac OS X threading:
  822. * Thread safe since version 10.5
  823. *
  824. * Parameters:
  825. *
  826. * user:
  827. * The user identity to access
  828. *
  829. * Result:
  830. * Returns true if the user is enabled. A user that is not enabled
  831. * cannot authenticate.
  832. *
  833. * Availability:
  834. * Mac OS X: in version 10.5 and later in CoreServices.framework
  835. * CarbonLib: not available
  836. * Non-Carbon CFM: not available
  837. }
  838. function CSIdentityIsEnabled( user: CSIdentityRef ): Boolean; external name '_CSIdentityIsEnabled';
  839. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  840. {
  841. * CSIdentityAuthenticateUsingPassword()
  842. *
  843. * Summary:
  844. * Attempt to autenticate a password for a user identity
  845. *
  846. * Mac OS X threading:
  847. * Thread safe since version 10.5
  848. *
  849. * Parameters:
  850. *
  851. * user:
  852. * The user identity to access
  853. *
  854. * password:
  855. * The password to authenticate
  856. *
  857. * Result:
  858. * Returns true if the passord is correct for the specified user
  859. *
  860. * Availability:
  861. * Mac OS X: in version 10.5 and later in CoreServices.framework
  862. * CarbonLib: not available
  863. * Non-Carbon CFM: not available
  864. }
  865. function CSIdentityAuthenticateUsingPassword( user: CSIdentityRef; password: CFStringRef ): Boolean; external name '_CSIdentityAuthenticateUsingPassword';
  866. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  867. {
  868. * CSIdentityGetCertificate()
  869. *
  870. * Summary:
  871. * Get a user's authentication certificate
  872. *
  873. * Discussion:
  874. * The authentication certificate can be used in PKI-based protocols
  875. * to authenticate users.
  876. *
  877. * Mac OS X threading:
  878. * Thread safe since version 10.5
  879. *
  880. * Parameters:
  881. *
  882. * user:
  883. * The user identity to access
  884. *
  885. * Result:
  886. * The identity's certificate, or NULL if there is no certificate.
  887. * The identity object may release its reference to the return value
  888. * when the identity is modified.
  889. *
  890. * Availability:
  891. * Mac OS X: in version 10.5 and later in CoreServices.framework
  892. * CarbonLib: not available
  893. * Non-Carbon CFM: not available
  894. }
  895. function CSIdentityGetCertificate( user: CSIdentityRef ): SecCertificateRef; external name '_CSIdentityGetCertificate';
  896. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  897. {
  898. *
  899. * Methods which apply only to groups
  900. *
  901. }
  902. {
  903. * CSIdentityCreateGroupMembershipQuery()
  904. *
  905. * Summary:
  906. * Creates a query to find a group's members
  907. *
  908. * Discussion:
  909. * Using a query to lookup group membership allows the caller to
  910. * execute the query synchronously or asynchronously.
  911. *
  912. * Mac OS X threading:
  913. * Thread safe since version 10.5
  914. *
  915. * Parameters:
  916. *
  917. * allocator:
  918. * The allocator to use for the query
  919. *
  920. * group:
  921. * The group identity whose members are to be queried
  922. *
  923. * Result:
  924. * The CSIdentityQueryRef of the newly created object. The query is
  925. * ready to be executed.
  926. *
  927. * Availability:
  928. * Mac OS X: in version 10.5 and later in CoreServices.framework
  929. * CarbonLib: not available
  930. * Non-Carbon CFM: not available
  931. }
  932. function CSIdentityCreateGroupMembershipQuery( allocator: CFAllocatorRef; group: CSIdentityRef ): CSIdentityQueryRef; external name '_CSIdentityCreateGroupMembershipQuery';
  933. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  934. {
  935. *
  936. * Methods that modify identities
  937. *
  938. }
  939. {
  940. * CSIdentitySetFullName()
  941. *
  942. * Summary:
  943. * Sets an identity's full name.
  944. *
  945. * Discussion:
  946. * This change must be committed.
  947. *
  948. * Mac OS X threading:
  949. * Thread safe since version 10.5
  950. *
  951. * Parameters:
  952. *
  953. * identity:
  954. * The identity object to access
  955. *
  956. * fullName:
  957. * The new full name of the identity
  958. *
  959. * Availability:
  960. * Mac OS X: in version 10.5 and later in CoreServices.framework
  961. * CarbonLib: not available
  962. * Non-Carbon CFM: not available
  963. }
  964. procedure CSIdentitySetFullName( identity: CSIdentityRef; fullName: CFStringRef ); external name '_CSIdentitySetFullName';
  965. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  966. {
  967. * CSIdentitySetEmailAddress()
  968. *
  969. * Summary:
  970. * Set an identity's email address
  971. *
  972. * Discussion:
  973. * This change must be committed.
  974. *
  975. * Mac OS X threading:
  976. * Thread safe since version 10.5
  977. *
  978. * Parameters:
  979. *
  980. * identity:
  981. * The user identity to access
  982. *
  983. * emailAddress:
  984. * The user's new email address value. Pass NULL to remove an
  985. * email address.
  986. *
  987. * Availability:
  988. * Mac OS X: in version 10.5 and later in CoreServices.framework
  989. * CarbonLib: not available
  990. * Non-Carbon CFM: not available
  991. }
  992. procedure CSIdentitySetEmailAddress( identity: CSIdentityRef; emailAddress: CFStringRef { can be NULL } ); external name '_CSIdentitySetEmailAddress';
  993. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  994. {
  995. * CSIdentitySetImageURL()
  996. *
  997. * Summary:
  998. * Set the URL of an identity's external image storage
  999. *
  1000. * Discussion:
  1001. * This change must be committed.
  1002. *
  1003. * Mac OS X threading:
  1004. * Thread safe since version 10.5
  1005. *
  1006. * Parameters:
  1007. *
  1008. * identity:
  1009. * The identity to access
  1010. *
  1011. * url:
  1012. * The URL file of the image. For local identities, this must be a
  1013. * file URL. Pass NULL to remove the image URL from the identity.
  1014. *
  1015. * Availability:
  1016. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1017. * CarbonLib: not available
  1018. * Non-Carbon CFM: not available
  1019. }
  1020. procedure CSIdentitySetImageURL( identity: CSIdentityRef; url: CFURLRef { can be NULL } ); external name '_CSIdentitySetImageURL';
  1021. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1022. {
  1023. * CSIdentitySetImageData()
  1024. *
  1025. * Summary:
  1026. * Set the internally-stored image data and data type for an identity
  1027. *
  1028. * Discussion:
  1029. * This change must be committed.
  1030. *
  1031. * Mac OS X threading:
  1032. * Thread safe since version 10.5
  1033. *
  1034. * Parameters:
  1035. *
  1036. * identity:
  1037. * The identity to access
  1038. *
  1039. * imageData:
  1040. * The image data. Pass NULL to remove image data.
  1041. *
  1042. * imageDataType:
  1043. * The uniform type identitier (UTI) of the image data. Currently,
  1044. * kUTTypeJPEG ("public.jpeg") is the only type supported.
  1045. *
  1046. * Availability:
  1047. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1048. * CarbonLib: not available
  1049. * Non-Carbon CFM: not available
  1050. }
  1051. procedure CSIdentitySetImageData( identity: CSIdentityRef; imageData: CFDataRef { can be NULL }; imageDataType: CFStringRef { can be NULL } ); external name '_CSIdentitySetImageData';
  1052. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1053. {
  1054. * CSIdentityAddAlias()
  1055. *
  1056. * Summary:
  1057. * Add a name alias to an identity
  1058. *
  1059. * Discussion:
  1060. * This change must be committed.
  1061. *
  1062. * Mac OS X threading:
  1063. * Thread safe since version 10.5
  1064. *
  1065. * Parameters:
  1066. *
  1067. * identity:
  1068. * The identity to access
  1069. *
  1070. * alias:
  1071. * The alias to add
  1072. *
  1073. * Availability:
  1074. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1075. * CarbonLib: not available
  1076. * Non-Carbon CFM: not available
  1077. }
  1078. procedure CSIdentityAddAlias( identity: CSIdentityRef; alias: CFStringRef ); external name '_CSIdentityAddAlias';
  1079. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1080. {
  1081. * CSIdentityRemoveAlias()
  1082. *
  1083. * Summary:
  1084. * Remove an alias name from an identity
  1085. *
  1086. * Discussion:
  1087. * This change must be committed.
  1088. *
  1089. * Mac OS X threading:
  1090. * Thread safe since version 10.5
  1091. *
  1092. * Parameters:
  1093. *
  1094. * identity:
  1095. * The identity to access
  1096. *
  1097. * alias:
  1098. * The alias name to remove
  1099. *
  1100. * Availability:
  1101. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1102. * CarbonLib: not available
  1103. * Non-Carbon CFM: not available
  1104. }
  1105. procedure CSIdentityRemoveAlias( identity: CSIdentityRef; alias: CFStringRef ); external name '_CSIdentityRemoveAlias';
  1106. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1107. {
  1108. *
  1109. * Methods that modify group membership
  1110. *
  1111. }
  1112. {
  1113. * CSIdentityAddMember()
  1114. *
  1115. * Summary:
  1116. * Add an identity to a group
  1117. *
  1118. * Discussion:
  1119. * This change to the group must be committed.
  1120. *
  1121. * Mac OS X threading:
  1122. * Thread safe since version 10.5
  1123. *
  1124. * Parameters:
  1125. *
  1126. * group:
  1127. * The group identity to access
  1128. *
  1129. * member:
  1130. * The identity to add to the group. Can be a user or group
  1131. * identity.
  1132. *
  1133. * Availability:
  1134. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1135. * CarbonLib: not available
  1136. * Non-Carbon CFM: not available
  1137. }
  1138. procedure CSIdentityAddMember( group: CSIdentityRef; member: CSIdentityRef ); external name '_CSIdentityAddMember';
  1139. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1140. {
  1141. * CSIdentityRemoveMember()
  1142. *
  1143. * Summary:
  1144. * Remove a member from a group
  1145. *
  1146. * Discussion:
  1147. * This change to the group must be committed.
  1148. *
  1149. * Mac OS X threading:
  1150. * Thread safe since version 10.5
  1151. *
  1152. * Parameters:
  1153. *
  1154. * group:
  1155. * The group identity to access
  1156. *
  1157. * member:
  1158. * The member identity to remove
  1159. *
  1160. * Availability:
  1161. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1162. * CarbonLib: not available
  1163. * Non-Carbon CFM: not available
  1164. }
  1165. procedure CSIdentityRemoveMember( group: CSIdentityRef; member: CSIdentityRef ); external name '_CSIdentityRemoveMember';
  1166. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1167. {
  1168. Methods that modfify user credentials
  1169. }
  1170. {
  1171. * CSIdentitySetIsEnabled()
  1172. *
  1173. * Summary:
  1174. * Enable or disable a user
  1175. *
  1176. * Discussion:
  1177. * A disabled user account cannot authenticate. Credentials
  1178. * (password and certificate) are not affected. This change must be
  1179. * committed.
  1180. *
  1181. * Mac OS X threading:
  1182. * Thread safe since version 10.5
  1183. *
  1184. * Parameters:
  1185. *
  1186. * user:
  1187. * The identity object to access
  1188. *
  1189. * isEnabled:
  1190. * The new value of the isEnabled attribute
  1191. *
  1192. * Availability:
  1193. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1194. * CarbonLib: not available
  1195. * Non-Carbon CFM: not available
  1196. }
  1197. procedure CSIdentitySetIsEnabled( user: CSIdentityRef; isEnabled: Boolean ); external name '_CSIdentitySetIsEnabled';
  1198. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1199. {
  1200. * CSIdentitySetPassword()
  1201. *
  1202. * Summary:
  1203. * Set a user password
  1204. *
  1205. * Discussion:
  1206. * Setting the password to NULL removes the current password and
  1207. * disables password authentication for the user. Setting the
  1208. * password to a zero-length string allows authentication with a
  1209. * blank password. This change must be committed.
  1210. *
  1211. * Mac OS X threading:
  1212. * Thread safe since version 10.5
  1213. *
  1214. * Parameters:
  1215. *
  1216. * user:
  1217. * The user identity to access
  1218. *
  1219. * password:
  1220. * The new password, or NULL to remove the current password and
  1221. * disable password-based authentication
  1222. *
  1223. * Availability:
  1224. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1225. * CarbonLib: not available
  1226. * Non-Carbon CFM: not available
  1227. }
  1228. procedure CSIdentitySetPassword( user: CSIdentityRef; password: CFStringRef { can be NULL } ); external name '_CSIdentitySetPassword';
  1229. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1230. {
  1231. * CSIdentitySetCertificate()
  1232. *
  1233. * Summary:
  1234. * Set a user's authentication certificate
  1235. *
  1236. * Discussion:
  1237. * The subject name in the certificate will function as an alias for
  1238. * the identity. As with all identity names, the subject name must
  1239. * be unique within the entire name space of the identity authority.
  1240. * This change must be submitted.
  1241. *
  1242. * Mac OS X threading:
  1243. * Thread safe since version 10.5
  1244. *
  1245. * Parameters:
  1246. *
  1247. * user:
  1248. * The user identity to access
  1249. *
  1250. * certificate:
  1251. * The user's certificate, or NULL to remove the current
  1252. * certificate
  1253. *
  1254. * Availability:
  1255. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1256. * CarbonLib: not available
  1257. * Non-Carbon CFM: not available
  1258. }
  1259. procedure CSIdentitySetCertificate( user: CSIdentityRef; certificate: SecCertificateRef { can be NULL } ); external name '_CSIdentitySetCertificate';
  1260. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1261. {
  1262. *
  1263. * Permanent Deletion
  1264. *
  1265. }
  1266. {
  1267. * CSIdentityDelete()
  1268. *
  1269. * Summary:
  1270. * Permanently delete an identity from the identity database
  1271. *
  1272. * Discussion:
  1273. * Sets an identity to deleted state. This change must be committed.
  1274. *
  1275. * Mac OS X threading:
  1276. * Thread safe since version 10.5
  1277. *
  1278. * Parameters:
  1279. *
  1280. * identity:
  1281. * The identity to delete
  1282. *
  1283. * Availability:
  1284. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1285. * CarbonLib: not available
  1286. * Non-Carbon CFM: not available
  1287. }
  1288. procedure CSIdentityDelete( identity: CSIdentityRef ); external name '_CSIdentityDelete';
  1289. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1290. {
  1291. *
  1292. *
  1293. * Committing changes
  1294. *
  1295. }
  1296. {
  1297. * CSIdentityCommit()
  1298. *
  1299. * Summary:
  1300. * Synchronously commit all pending changes to the identity
  1301. * authority database
  1302. *
  1303. * Mac OS X threading:
  1304. * Thread safe since version 10.5
  1305. *
  1306. * Parameters:
  1307. *
  1308. * identity:
  1309. * The identity to commit
  1310. *
  1311. * authorization:
  1312. * The authorization object holding credentials necessary to allow
  1313. * modification to the identity database. As a convenience,
  1314. * callers may pass NULL for the authorization, and the
  1315. * implmentation will attempt to acquire the necessary credentials
  1316. * from Authorization Services.
  1317. *
  1318. * error:
  1319. * Optional pointer to a CFErrorRef which will be set if this
  1320. * function returns false. When this occurs, the caller is
  1321. * responsible for releasing the error.
  1322. *
  1323. * Result:
  1324. * Returns true if successful, false if an error occurred
  1325. *
  1326. * Availability:
  1327. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1328. * CarbonLib: not available
  1329. * Non-Carbon CFM: not available
  1330. }
  1331. function CSIdentityCommit( identity: CSIdentityRef; authorization: AuthorizationRef { can be NULL }; error: CFErrorRefPtr { can be NULL } ): Boolean; external name '_CSIdentityCommit';
  1332. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1333. {
  1334. * Status values
  1335. *
  1336. }
  1337. const
  1338. {
  1339. * The identity has been committed to the authority database
  1340. }
  1341. kCSIdentityCommitCompleted = 1;
  1342. type
  1343. CSIdentityStatusUpdatedCallback = procedure( identity: CSIdentityRef; status: CFIndex; error: CFErrorRef; info: UnivPtr );
  1344. {
  1345. * CSIdentityClientContext
  1346. *
  1347. * Discussion:
  1348. * Structure containing the user-defined data and callbacks used
  1349. * during asynchronous commits
  1350. }
  1351. type
  1352. CSIdentityClientContext = record
  1353. {
  1354. * The version number of the client structure type. The current
  1355. * version number is 0.
  1356. }
  1357. version: CFIndex;
  1358. {
  1359. * An arbitrary pointer to client-defined data, which can be
  1360. * associated with the client and is passed to the callbacks.
  1361. }
  1362. info: UnivPtr;
  1363. {
  1364. * The callback used to add a retain for the on the client object for
  1365. * the life of the asynchronous operation, and may be used for
  1366. * temporary references the identity needs to take. This callback
  1367. * returns the actual info pointer to be passed to the statusUpdated
  1368. * callback. May be NULL.
  1369. }
  1370. retain: CFAllocatorRetainCallBack;
  1371. {
  1372. * The callback used to remove a retain previously acquired for the
  1373. * client object. May be NULL.
  1374. }
  1375. release: CFAllocatorReleaseCallBack;
  1376. {
  1377. * The callback used to create a descriptive string representation of
  1378. * the client object for debugging purposes. This is used by the
  1379. * CFCopyDescription() function. May be NULL.
  1380. }
  1381. copyDescription: CFAllocatorCopyDescriptionCallBack;
  1382. {
  1383. * The client callback invoked when the status of an asnchronous
  1384. * operation changes
  1385. }
  1386. statusUpdated: CSIdentityStatusUpdatedCallback;
  1387. end;
  1388. {
  1389. * CSIdentityCommitAsynchronously()
  1390. *
  1391. * Summary:
  1392. * Asychronously commit all pending changes to the identity
  1393. * authority's database
  1394. *
  1395. * Mac OS X threading:
  1396. * Thread safe since version 10.5
  1397. *
  1398. * Parameters:
  1399. *
  1400. * identity:
  1401. * The identity to commit
  1402. *
  1403. * clientContext:
  1404. * The client structure specifying context and callbacks for the
  1405. * asynchronous operation
  1406. *
  1407. * runLoop:
  1408. * The run loop on which to schedule the statusUpdated callback
  1409. *
  1410. * runLoopMode:
  1411. * The run loop mode in which the callback can be scheduled
  1412. *
  1413. * authorization:
  1414. * The authorization object holding credentials necessary to allow
  1415. * modification to the identity database. As a convenience,
  1416. * callers may pass NULL for the authorization, and the
  1417. * implmentation will attempt to acquire the necessary credentials
  1418. * from Authorization Services. Modifying the local system
  1419. * identity database requires Admin credentials.
  1420. *
  1421. * Result:
  1422. * Returns true if the commit operation is started, indicated that
  1423. * an statusUpdated callback will follow. Returns false if the
  1424. * identity has no uncommitted changes or a commit is already in
  1425. * progress
  1426. *
  1427. * Availability:
  1428. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1429. * CarbonLib: not available
  1430. * Non-Carbon CFM: not available
  1431. }
  1432. function CSIdentityCommitAsynchronously( identity: CSIdentityRef; const (*var*) clientContext: CSIdentityClientContext; runLoop: CFRunLoopRef; runLoopMode: CFStringRef; authorization: AuthorizationRef { can be NULL } ): Boolean; external name '_CSIdentityCommitAsynchronously';
  1433. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1434. {
  1435. * CSIdentityIsCommitting()
  1436. *
  1437. * Summary:
  1438. * Determine if a commit operation is in progress
  1439. *
  1440. * Mac OS X threading:
  1441. * Thread safe since version 10.5
  1442. *
  1443. * Parameters:
  1444. *
  1445. * identity:
  1446. * The identity to access
  1447. *
  1448. * Result:
  1449. * Returns true if a commit operation is in progress
  1450. *
  1451. * Availability:
  1452. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1453. * CarbonLib: not available
  1454. * Non-Carbon CFM: not available
  1455. }
  1456. function CSIdentityIsCommitting( identity: CSIdentityRef ): Boolean; external name '_CSIdentityIsCommitting';
  1457. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1458. {
  1459. * CSIdentityRemoveClient()
  1460. *
  1461. * Summary:
  1462. * Invalidate an identity's client structure to stop client callbacks
  1463. *
  1464. * Discussion:
  1465. * After returning, this function guarantees that client callbacks
  1466. * will never be invoked again. Use this function when releasing an
  1467. * identity which may have an outstanding asynchronous request. This
  1468. * function does not cancel an outstanding commit operation because
  1469. * a commit cannot be interrupted.
  1470. *
  1471. * Mac OS X threading:
  1472. * Thread safe since version 10.5
  1473. *
  1474. * Parameters:
  1475. *
  1476. * identity:
  1477. * The identity to access
  1478. *
  1479. * Availability:
  1480. * Mac OS X: in version 10.5 and later in CoreServices.framework
  1481. * CarbonLib: not available
  1482. * Non-Carbon CFM: not available
  1483. }
  1484. procedure CSIdentityRemoveClient( identity: CSIdentityRef ); external name '_CSIdentityRemoveClient';
  1485. (* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER *)
  1486. {$endc} {TARGET_OS_MAC}
  1487. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  1488. end.
  1489. {$endc} {not MACOSALLINCLUDE}