CSIdentity.pas 45 KB

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