Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

336 lines
7.8 KiB

  1. /*
  2. File: KeychainHI.h
  3. Contains: Keychain API's with Human Interfaces
  4. Version: QuickTime 7.3
  5. Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://developer.apple.com/bugreporter/
  9. */
  10. #ifndef __KEYCHAINCORE__
  11. #include <KeychainCore.h>
  12. #endif
  13. #ifndef __CFSTRING__
  14. #include <CFString.h>
  15. #endif
  16. #ifndef __CFARRAY__
  17. #include <CFArray.h>
  18. #endif
  19. #ifndef __CFDATE__
  20. #include <CFDate.h>
  21. #endif
  22. #if PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. #if PRAGMA_IMPORT
  29. #pragma import on
  30. #endif
  31. /* High-level interface for storing passwords */
  32. /*
  33. * KCAddAppleSharePassword()
  34. *
  35. * Availability:
  36. * Non-Carbon CFM: in KeychainLib 1.0 and later
  37. * CarbonLib: in CarbonLib 1.1 and later
  38. * Mac OS X: in version 10.0 and later
  39. */
  40. EXTERN_API( OSStatus )
  41. KCAddAppleSharePassword(
  42. AFPServerSignature * serverSignature,
  43. StringPtr serverAddress,
  44. StringPtr serverName,
  45. StringPtr volumeName,
  46. StringPtr accountName,
  47. UInt32 passwordLength,
  48. const void * passwordData,
  49. KCItemRef * item); /* can be NULL */
  50. /*
  51. * KCAddInternetPassword()
  52. *
  53. * Availability:
  54. * Non-Carbon CFM: in KeychainLib 1.0 and later
  55. * CarbonLib: in CarbonLib 1.1 and later
  56. * Mac OS X: in version 10.0 and later
  57. */
  58. EXTERN_API( OSStatus )
  59. KCAddInternetPassword(
  60. StringPtr serverName,
  61. StringPtr securityDomain,
  62. StringPtr accountName,
  63. UInt16 port,
  64. OSType protocol,
  65. OSType authType,
  66. UInt32 passwordLength,
  67. const void * passwordData,
  68. KCItemRef * item); /* can be NULL */
  69. /*
  70. * KCAddInternetPasswordWithPath()
  71. *
  72. * Availability:
  73. * Non-Carbon CFM: in KeychainLib 2.0 and later
  74. * CarbonLib: in CarbonLib 1.1 and later
  75. * Mac OS X: in version 10.0 and later
  76. */
  77. EXTERN_API( OSStatus )
  78. KCAddInternetPasswordWithPath(
  79. StringPtr serverName,
  80. StringPtr securityDomain,
  81. StringPtr accountName,
  82. StringPtr path,
  83. UInt16 port,
  84. OSType protocol,
  85. OSType authType,
  86. UInt32 passwordLength,
  87. const void * passwordData,
  88. KCItemRef * item); /* can be NULL */
  89. /*
  90. * KCAddGenericPassword()
  91. *
  92. * Availability:
  93. * Non-Carbon CFM: in KeychainLib 1.0 and later
  94. * CarbonLib: in CarbonLib 1.1 and later
  95. * Mac OS X: in version 10.0 and later
  96. */
  97. EXTERN_API( OSStatus )
  98. KCAddGenericPassword(
  99. StringPtr serviceName,
  100. StringPtr accountName,
  101. UInt32 passwordLength,
  102. const void * passwordData,
  103. KCItemRef * item); /* can be NULL */
  104. /* Low-level interface for storing keychain items */
  105. /*
  106. * KCAddItem()
  107. *
  108. * Availability:
  109. * Non-Carbon CFM: in KeychainLib 1.0 and later
  110. * CarbonLib: in CarbonLib 1.1 and later
  111. * Mac OS X: in version 10.0 and later
  112. */
  113. EXTERN_API( OSStatus )
  114. KCAddItem(KCItemRef item);
  115. /* Managing keychains */
  116. /*
  117. * KCUnlock()
  118. *
  119. * Availability:
  120. * Non-Carbon CFM: in KeychainLib 1.0 and later
  121. * CarbonLib: in CarbonLib 1.1 and later
  122. * Mac OS X: in version 10.0 and later
  123. */
  124. EXTERN_API( OSStatus )
  125. KCUnlock(
  126. KCRef keychain, /* can be NULL */
  127. StringPtr password); /* can be NULL */
  128. /*
  129. * KCCreateKeychain()
  130. *
  131. * Availability:
  132. * Non-Carbon CFM: in KeychainLib 1.0 and later
  133. * CarbonLib: in CarbonLib 1.1 and later
  134. * Mac OS X: in version 10.0 and later
  135. */
  136. EXTERN_API( OSStatus )
  137. KCCreateKeychain(
  138. StringPtr password, /* can be NULL */
  139. KCRef * keychain); /* can be NULL */
  140. /*
  141. * KCChangeSettings()
  142. *
  143. * Availability:
  144. * Non-Carbon CFM: in KeychainLib 2.0 and later
  145. * CarbonLib: in CarbonLib 1.1 and later
  146. * Mac OS X: in version 10.0 and later
  147. */
  148. EXTERN_API( OSStatus )
  149. KCChangeSettings(KCRef keychain);
  150. /*
  151. * kcunlock()
  152. *
  153. * Availability:
  154. * Non-Carbon CFM: in KeychainLib 1.0 and later
  155. * CarbonLib: in CarbonLib 1.1 and later
  156. * Mac OS X: in version 10.0 and later
  157. */
  158. EXTERN_API_C( OSStatus )
  159. kcunlock(
  160. KCRef keychain, /* can be NULL */
  161. const char * password); /* can be NULL */
  162. /*
  163. * kccreatekeychain()
  164. *
  165. * Availability:
  166. * Non-Carbon CFM: in KeychainLib 1.0 and later
  167. * CarbonLib: in CarbonLib 1.1 and later
  168. * Mac OS X: in version 10.0 and later
  169. */
  170. EXTERN_API_C( OSStatus )
  171. kccreatekeychain(
  172. const char * password, /* can be NULL */
  173. KCRef * keychain); /* can be NULL */
  174. /*
  175. * kcaddapplesharepassword()
  176. *
  177. * Availability:
  178. * Non-Carbon CFM: in KeychainLib 1.0 and later
  179. * CarbonLib: in CarbonLib 1.1 and later
  180. * Mac OS X: in version 10.0 and later
  181. */
  182. EXTERN_API_C( OSStatus )
  183. kcaddapplesharepassword(
  184. AFPServerSignature * serverSignature,
  185. const char * serverAddress,
  186. const char * serverName,
  187. const char * volumeName,
  188. const char * accountName,
  189. UInt32 passwordLength,
  190. const void * passwordData,
  191. KCItemRef * item); /* can be NULL */
  192. /*
  193. * kcaddinternetpassword()
  194. *
  195. * Availability:
  196. * Non-Carbon CFM: in KeychainLib 1.0 and later
  197. * CarbonLib: in CarbonLib 1.1 and later
  198. * Mac OS X: in version 10.0 and later
  199. */
  200. EXTERN_API_C( OSStatus )
  201. kcaddinternetpassword(
  202. const char * serverName,
  203. const char * securityDomain,
  204. const char * accountName,
  205. UInt16 port,
  206. OSType protocol,
  207. OSType authType,
  208. UInt32 passwordLength,
  209. const void * passwordData,
  210. KCItemRef * item); /* can be NULL */
  211. /*
  212. * kcaddinternetpasswordwithpath()
  213. *
  214. * Availability:
  215. * Non-Carbon CFM: in KeychainLib 2.0 and later
  216. * CarbonLib: in CarbonLib 1.1 and later
  217. * Mac OS X: in version 10.0 and later
  218. */
  219. EXTERN_API_C( OSStatus )
  220. kcaddinternetpasswordwithpath(
  221. const char * serverName,
  222. const char * securityDomain,
  223. const char * accountName,
  224. const char * path,
  225. UInt16 port,
  226. OSType protocol,
  227. OSType authType,
  228. UInt32 passwordLength,
  229. const void * passwordData,
  230. KCItemRef * item); /* can be NULL */
  231. /*
  232. * kcaddgenericpassword()
  233. *
  234. * Availability:
  235. * Non-Carbon CFM: in KeychainLib 1.0 and later
  236. * CarbonLib: in CarbonLib 1.1 and later
  237. * Mac OS X: in version 10.0 and later
  238. */
  239. EXTERN_API_C( OSStatus )
  240. kcaddgenericpassword(
  241. const char * serviceName,
  242. const char * accountName,
  243. UInt32 passwordLength,
  244. const void * passwordData,
  245. KCItemRef * item); /* can be NULL */
  246. /* Working with certificates */
  247. #if CALL_NOT_IN_CARBON
  248. /*
  249. * KCFindX509Certificates()
  250. *
  251. * Availability:
  252. * Non-Carbon CFM: in KeychainLib 2.0 and later
  253. * CarbonLib: not available
  254. * Mac OS X: not available
  255. */
  256. EXTERN_API( OSStatus )
  257. KCFindX509Certificates(
  258. KCRef keychain,
  259. CFStringRef name,
  260. CFStringRef emailAddress,
  261. KCCertSearchOptions options,
  262. CFMutableArrayRef * certificateItems); /* can be NULL */
  263. /*
  264. * KCChooseCertificate()
  265. *
  266. * Availability:
  267. * Non-Carbon CFM: in KeychainLib 2.0 and later
  268. * CarbonLib: not available
  269. * Mac OS X: not available
  270. */
  271. EXTERN_API( OSStatus )
  272. KCChooseCertificate(
  273. CFArrayRef items,
  274. KCItemRef * certificate,
  275. CFArrayRef policyOIDs,
  276. KCVerifyStopOn stopOn);
  277. #endif /* CALL_NOT_IN_CARBON */
  278. #ifdef PRAGMA_IMPORT_OFF
  279. #pragma import off
  280. #elif PRAGMA_IMPORT
  281. #pragma import reset
  282. #endif
  283. #ifdef __cplusplus
  284. }
  285. #endif