CSIdentity.pas 45 KB

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