PageRenderTime 56ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/TestSuite/bin/Debug/PCSCMicro.xml

#
XML | 1307 lines | 1307 code | 0 blank | 0 comment | 0 complexity | 28931493b03612835f51c2b96959d6cf MD5 | raw file
Possible License(s): GPL-2.0

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

  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>PCSCMicro</name>
  5. </assembly>
  6. <members>
  7. <member name="T:PCSCMicro.HexStringDecoder">
  8. <summary>
  9. This class does conversions for the API
  10. </summary>
  11. <remarks>
  12. Most of the conversions involve hexidecimal notation strings
  13. or bytes, however there is a conversion from a uint to a byte
  14. array also which is used by BigInteger.
  15. </remarks>
  16. </member>
  17. <member name="M:PCSCMicro.HexStringDecoder.ByteToHex(System.Byte)">
  18. <summary>
  19. Converts a byte to hex string of length 2.
  20. </summary>
  21. <example>
  22. b = 204 = 0xCC, is decoded into "CC".
  23. </example>
  24. <remarks>
  25. Used for values from 0 to 0xFF = 255.
  26. </remarks>
  27. <param name="b">Value to be converted to hex</param>
  28. <returns>Hex string representation of b</returns>
  29. </member>
  30. <member name="M:PCSCMicro.HexStringDecoder.HexStringToInt(System.String)">
  31. <summary>
  32. Converts hex string of length 2 to int.
  33. </summary>
  34. <remarks>
  35. Used for values from 0 to 0xFF = 255.
  36. </remarks>
  37. <example>
  38. hexStr = "CC" is decoded into int 204 = 0xCC.
  39. </example>
  40. <param name="HexStr">Hex string to be converted to decimal.</param>
  41. <returns>Decimal representation of hexStr</returns>
  42. </member>
  43. <member name="M:PCSCMicro.HexStringDecoder.StringToByteArray(System.String)">
  44. <summary>
  45. Converts hex string of any length to a Byte array
  46. with same hex representation.
  47. </summary>
  48. <example>
  49. HexStr = C0AAC0C0CC80..., is decoded into
  50. byte array [ 0xC0, 0xAA, 0xC0, 0xC0, 0xCC, 0x80, ...].
  51. </example>
  52. <param name="HexStr">Hex string to be converted to decimal
  53. byte array</param>
  54. <returns>Decimal byte array representing HexStr</returns>
  55. </member>
  56. <member name="M:PCSCMicro.HexStringDecoder.Dec2Hex(System.UInt32)">
  57. <summary>
  58. Converts a uint number to equivalent hex value.
  59. </summary>
  60. <remarks>
  61. Used for values of up to 4294967295 = 0xFFFFFFFF.
  62. </remarks>
  63. <example>
  64. x = 4275878401 = 0xFEDCBA01 is decoded to "FEDCBA01".
  65. </example>
  66. <param name="x">Decimal value to convert to hex string</param>
  67. <returns>Hex string representing x</returns>
  68. </member>
  69. <member name="M:PCSCMicro.HexStringDecoder.uintToByteArray(System.UInt32)">
  70. <summary>
  71. Converts a uint number to equivalent byte array.
  72. </summary>
  73. <remarks>
  74. Used for values of up to 4294967295 = 0xFFFFFFFF.
  75. </remarks>
  76. <example>
  77. x = 4275878401 = 0xFEDCBA01 is decoded to [0xFE, 0xDC, 0xBA, 0x01].
  78. </example>
  79. <param name="x">uint to convert to ByteArray</param>
  80. <returns>Byte array of length 4 which when concatenated together
  81. has the same value as x</returns>
  82. </member>
  83. <member name="M:PCSCMicro.HexStringDecoder.ByteArrayToString(System.Byte[],System.Int32)">
  84. <summary>
  85. Converts a byte array to equivalent hex string.
  86. </summary>
  87. <example>
  88. ByteArray = [ 0xC0, 0xAA, 0xC0, 0xC0, 0xCC, 0x80]
  89. and bytecount = 6 is decoded to HexStr = "C0AAC0C0CC80".
  90. </example>
  91. <param name="ByteArray">Decimal byte array to be
  92. converted to a hex string</param>
  93. <param name="bytecount">Number of bytes from the array
  94. to be converted</param>
  95. <returns>Hex string representation of the first bytecount
  96. cells in ByteArray</returns>
  97. </member>
  98. <member name="T:PCSCMicro.SCardError">
  99. <summary>
  100. Error types for SCard
  101. </summary>
  102. <remarks>
  103. Some error values are never used. These were included
  104. in order to keep the PC/SC Micro API compatible
  105. with the PC/SC Lite API. They were also kept in to
  106. allow additions to be made to make functionality
  107. closer to that of the PC/SC Lite API.
  108. </remarks>
  109. </member>
  110. <member name="F:PCSCMicro.SCardError.SCARD_S_SUCCESS">
  111. <summary>
  112. Command successful
  113. </summary>
  114. </member>
  115. <member name="F:PCSCMicro.SCardError.SCARD_E_CANCELLED">
  116. <summary>
  117. Command cancelled
  118. </summary>
  119. </member>
  120. <member name="F:PCSCMicro.SCardError.SCARD_E_CANT_DISPOSE">
  121. <summary>
  122. Cannot dispose handle
  123. </summary>
  124. </member>
  125. <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_VALUE">
  126. <summary>
  127. Invalid value given
  128. </summary>
  129. </member>
  130. <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_HANDLE">
  131. <summary>
  132. Invalid handle given
  133. </summary>
  134. </member>
  135. <member name="F:PCSCMicro.SCardError.SCARD_E_NO_MEMORY">
  136. <summary>
  137. Not enough memory
  138. </summary>
  139. </member>
  140. <member name="F:PCSCMicro.SCardError.SCARD_E_UNSUPPORTED_INTERFACE">
  141. <summary>
  142. Interface not supported
  143. </summary>
  144. </member>
  145. <member name="F:PCSCMicro.SCardError.SCARD_E_UNSUPPORTED_FEATURE">
  146. <summary>
  147. Feature not supported
  148. </summary>
  149. </member>
  150. <member name="F:PCSCMicro.SCardError.SCARD_E_NOTIMPL">
  151. <summary>
  152. ???
  153. </summary>
  154. </member>
  155. <member name="F:PCSCMicro.SCardError.SCARD_E_UNSUPPORTED_FUNCTION">
  156. <summary>
  157. Function not supported
  158. </summary>
  159. </member>
  160. <member name="F:PCSCMicro.SCardError.SCARD_E_INSUFFICIENT_BUFFER">
  161. <summary>
  162. Insufficient buffer
  163. </summary>
  164. </member>
  165. <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_ATR">
  166. <summary>
  167. Invalid ATR
  168. </summary>
  169. </member>
  170. <member name="F:PCSCMicro.SCardError.SCARD_E_NO_SERVICE">
  171. <summary>
  172. Service not available
  173. </summary>
  174. </member>
  175. <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_PARAMETER">
  176. <summary>
  177. Invalid parameter given
  178. </summary>
  179. </member>
  180. <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_TARGET">
  181. <summary>
  182. Invalid target given
  183. </summary>
  184. </member>
  185. <member name="F:PCSCMicro.SCardError.SCARD_E_SERVICE_STOPPED">
  186. <summary>
  187. Service was stopped
  188. </summary>
  189. </member>
  190. <member name="F:PCSCMicro.SCardError.SCARD_F_COMM_ERROR">
  191. <summary>
  192. RPC transport error
  193. </summary>
  194. </member>
  195. <member name="F:PCSCMicro.SCardError.SCARD_F_INTERNAL_ERROR">
  196. <summary>
  197. Internal error
  198. </summary>
  199. </member>
  200. <member name="F:PCSCMicro.SCardError.SCARD_E_UNKNOWN_READER">
  201. <summary>
  202. Unknown error
  203. </summary>
  204. </member>
  205. <member name="F:PCSCMicro.SCardError.SCARD_E_TIMEOUT">
  206. <summary>
  207. Command timeout
  208. </summary>
  209. </member>
  210. <member name="F:PCSCMicro.SCardError.SCARD_E_SHARING_VIOLATION">
  211. <summary>
  212. Sharing violation
  213. </summary>
  214. </member>
  215. <member name="F:PCSCMicro.SCardError.SCARD_E_NO_SMARTCARD">
  216. <summary>
  217. No smart card inserted
  218. </summary>
  219. </member>
  220. <member name="F:PCSCMicro.SCardError.SCARD_E_UNKNOWN_CARD">
  221. <summary>
  222. Unknown card
  223. </summary>
  224. </member>
  225. <member name="F:PCSCMicro.SCardError.SCARD_E_NOT_READY">
  226. <summary>
  227. Subsystem not readey
  228. </summary>
  229. </member>
  230. <member name="F:PCSCMicro.SCardError.SCARD_E_SYSTEM_CANCELLED">
  231. <summary>
  232. System cancelled
  233. </summary>
  234. </member>
  235. <member name="F:PCSCMicro.SCardError.SCARD_E_NOT_TRANSACTED">
  236. <summary>
  237. Transaction failed
  238. </summary>
  239. </member>
  240. <member name="F:PCSCMicro.SCardError.SCARD_E_READER_UNAVAILABLE">
  241. <summary>
  242. Reader is unavailable
  243. </summary>
  244. </member>
  245. <member name="F:PCSCMicro.SCardError.SCARD_F_UNKNOWN_ERROR">
  246. <summary>
  247. Unknown error
  248. </summary>
  249. </member>
  250. <member name="F:PCSCMicro.SCardError.SCARD_W_UNSUPPORTED_CARD">
  251. <summary>
  252. Card is not supported
  253. </summary>
  254. </member>
  255. <member name="F:PCSCMicro.SCardError.SCARD_W_UNRESPONSIVE_CARD">
  256. <summary>
  257. Card is unresponsive
  258. </summary>
  259. </member>
  260. <member name="F:PCSCMicro.SCardError.SCARD_W_UNPOWERED_CARD">
  261. <summary>
  262. Card is unpowered
  263. </summary>
  264. </member>
  265. <member name="F:PCSCMicro.SCardError.SCARD_W_RESET_CARD">
  266. <summary>
  267. Card was reset
  268. </summary>
  269. </member>
  270. <member name="F:PCSCMicro.SCardError.SCARD_W_REMOVED_CARD">
  271. <summary>
  272. Card was removed
  273. </summary>
  274. </member>
  275. <member name="F:PCSCMicro.SCardError.SCARD_W_INSERTED_CARD">
  276. <summary>
  277. Card was inserted
  278. </summary>
  279. </member>
  280. <member name="F:PCSCMicro.SCardError.SCARD_E_READER_UNSUPPORTED">
  281. <summary>
  282. Reader is unsupported
  283. </summary>
  284. </member>
  285. <member name="F:PCSCMicro.SCardError.SCARD_E_CARD_UNSUPPORTED">
  286. <summary>
  287. Card is unsupported
  288. </summary>
  289. </member>
  290. <member name="F:PCSCMicro.SCardError.SCARD_E_DUPLICATE_READER">
  291. <summary>
  292. Reader already exists
  293. </summary>
  294. </member>
  295. <member name="F:PCSCMicro.SCardError.SCARD_E_PCI_TOO_SMALL">
  296. <summary>
  297. PCI struct too small
  298. </summary>
  299. </member>
  300. <member name="F:PCSCMicro.SCardError.SCARD_E_PROTO_MISMATCH">
  301. <summary>
  302. Card protocol mismatch
  303. </summary>
  304. </member>
  305. <member name="F:PCSCMicro.SCardError.SCARD_F_WAITED_TOO_LONG">
  306. <summary>
  307. Waited too long
  308. </summary>
  309. </member>
  310. <member name="F:PCSCMicro.SCardError.SCARD_E_NO_READERS_AVAILABLE">
  311. <summary>
  312. Cannot find a smart card reader
  313. </summary>
  314. </member>
  315. <member name="T:PCSCMicro.SCardProtocol">
  316. <summary>
  317. Protocols for SCard
  318. </summary>
  319. </member>
  320. <member name="F:PCSCMicro.SCardProtocol.T0">
  321. <summary>
  322. T = 0 Protocol
  323. </summary>
  324. </member>
  325. <member name="F:PCSCMicro.SCardProtocol.T1">
  326. <summary>
  327. T = 1 Protocol
  328. </summary>
  329. </member>
  330. <member name="T:PCSCMicro.SCardDisposition">
  331. <summary>
  332. Actions to be taken in regards to deactivating smart card
  333. </summary>
  334. </member>
  335. <member name="F:PCSCMicro.SCardDisposition.LEAVE_CARD">
  336. <summary>
  337. Do nothing to card
  338. </summary>
  339. </member>
  340. <member name="F:PCSCMicro.SCardDisposition.RESET_CARD">
  341. <summary>
  342. Reset the card
  343. </summary>
  344. </member>
  345. <member name="F:PCSCMicro.SCardDisposition.UNPOWER_CARD">
  346. <summary>
  347. Turn off the card
  348. </summary>
  349. </member>
  350. <member name="T:PCSCMicro.SCardState">
  351. <summary>
  352. States in which the card can be
  353. </summary>
  354. </member>
  355. <member name="F:PCSCMicro.SCardState.ABSENT">
  356. <summary>
  357. Card is absent
  358. </summary>
  359. </member>
  360. <member name="F:PCSCMicro.SCardState.PRESENT">
  361. <summary>
  362. Card is present
  363. </summary>
  364. </member>
  365. <member name="F:PCSCMicro.SCardState.ACTIVATED">
  366. <summary>
  367. Card is activated
  368. </summary>
  369. </member>
  370. <member name="F:PCSCMicro.SCardState.ERROR">
  371. <summary>
  372. Error has occurred, card is in error state
  373. </summary>
  374. </member>
  375. <member name="T:PCSCMicro.SCardShareMode">
  376. <summary>
  377. Share modes for readers
  378. </summary>
  379. </member>
  380. <member name="F:PCSCMicro.SCardShareMode.SHARED">
  381. <summary>
  382. Handle is allowing other handles to share card and reader
  383. </summary>
  384. </member>
  385. <member name="F:PCSCMicro.SCardShareMode.EXCLUSIVE">
  386. <summary>
  387. Handle has exclusive rights to card and reader
  388. </summary>
  389. </member>
  390. <member name="T:PCSCMicro.SCardHandle">
  391. <summary>
  392. Class representing the smart card and reader
  393. </summary>
  394. </member>
  395. <member name="M:PCSCMicro.SCardHandle.#ctor">
  396. <summary>
  397. Constructor
  398. </summary>
  399. </member>
  400. <member name="M:PCSCMicro.SCardHandle.Connect(PCSCMicro.SCardShareMode,PCSCMicro.SCardProtocol,System.String)">
  401. <summary>
  402. Sets variables, changes state to connected
  403. </summary>
  404. <param name="share">Share mode to be used by Handle</param>
  405. <param name="proto">Protocol to be used by Handle</param>
  406. <param name="Atr">ATR of the card in the reader</param>
  407. </member>
  408. <member name="M:PCSCMicro.SCardHandle.Disconnect">
  409. <summary>
  410. Changes to disconnected state
  411. </summary>
  412. </member>
  413. <member name="P:PCSCMicro.SCardHandle.Connected">
  414. <summary>
  415. Gets whether card is connected
  416. </summary>
  417. <returns>True if card is connected, false otherwise</returns>
  418. </member>
  419. <member name="P:PCSCMicro.SCardHandle.Protocol">
  420. <summary>
  421. Gets the protocol used by this SCardHandle
  422. </summary>
  423. <returns>Protocol used by this SCardHandle</returns>
  424. </member>
  425. <member name="P:PCSCMicro.SCardHandle.ATR">
  426. <summary>
  427. Gets the ATR associated with the smart card
  428. </summary>
  429. <returns>ATR associated with the smart card</returns>
  430. </member>
  431. <member name="P:PCSCMicro.SCardHandle.ShareMode">
  432. <summary>
  433. Gets the share mode used by this SCardHandle
  434. </summary>
  435. <returns>Share mode used by this SCardHandle</returns>
  436. </member>
  437. <member name="T:PCSCMicro.SCardContext">
  438. <summary>
  439. Class representing a context
  440. </summary>
  441. <remarks>
  442. A context in the standard PC/SC Lite API acts as a pointer
  443. to the resource manager. Since there is no resource manager,
  444. a context in the PC/SC Micro API acts as a way of accessing
  445. the rest of the functions in the API. An application must first
  446. establish a context before doing anything else with the API. A
  447. context in this definition can only be established, be released,
  448. or check if it is valid.
  449. </remarks>
  450. </member>
  451. <member name="M:PCSCMicro.SCardContext.#ctor">
  452. <summary>
  453. Constructor
  454. </summary>
  455. </member>
  456. <member name="M:PCSCMicro.SCardContext.Establish">
  457. <summary>
  458. Sets context as valid
  459. </summary>
  460. </member>
  461. <member name="M:PCSCMicro.SCardContext.Release">
  462. <summary>
  463. Sets context as invalid
  464. </summary>
  465. </member>
  466. <member name="P:PCSCMicro.SCardContext.IsValid">
  467. <summary>
  468. Gets whether SCardContext is valid
  469. </summary>
  470. <returns>True if SCardContext is valid, false otherwise</returns>
  471. </member>
  472. <member name="T:PCSCMicro.SCardStatusReturn">
  473. <summary>
  474. Class representing return of Status and GetStatusChange
  475. </summary>
  476. </member>
  477. <member name="M:PCSCMicro.SCardStatusReturn.#ctor(PCSCMicro.SCardState,System.String,PCSCMicro.SCardProtocol)">
  478. <summary>
  479. Constructor
  480. </summary>
  481. <param name="status">Status of card</param>
  482. <param name="Atr">ATR of card</param>
  483. <param name="proto">Protocol used with SCardHandle</param>
  484. </member>
  485. <member name="M:PCSCMicro.SCardStatusReturn.Equals(PCSCMicro.SCardStatusReturn)">
  486. <summary>
  487. Equals method for SCardStatusReturn objects
  488. </summary>
  489. <param name="value">Second SCardStatusReturn object</param>
  490. <returns>True if two SCardStatusReturn objects are equal,
  491. false if second object is not a SCardStatusReturn object
  492. or if they are not equal</returns>
  493. </member>
  494. <member name="P:PCSCMicro.SCardStatusReturn.ATR">
  495. <summary>
  496. Gets the ATR associated with the smart card
  497. </summary>
  498. <returns>ATR associated with the smart card</returns>
  499. </member>
  500. <member name="P:PCSCMicro.SCardStatusReturn.Protocol">
  501. <summary>
  502. Gets the protocol used by this SCardHandle
  503. </summary>
  504. <returns>Protocol used by this SCardHandle</returns>
  505. </member>
  506. <member name="P:PCSCMicro.SCardStatusReturn.State">
  507. <summary>
  508. Gets the status of the card
  509. </summary>
  510. <returns>Status of the card</returns>
  511. </member>
  512. <member name="T:PCSCMicro.SCard">
  513. <summary>
  514. This class is used to call all of the PC/SC Micro API functions
  515. </summary>
  516. <remarks>
  517. <para>
  518. This API assumes a working version of Device.cs
  519. exists in the project with all of the necessary functions.
  520. It was created to be used on the Teridian 73S1209F eval board
  521. and the GemCore Serial Lite Pro eval board. The API can be ported
  522. onto other reader chips if a Device.cs file is created for them that
  523. is a child of the Reader.cs class. All of the public functions are
  524. static, so no SCard object needs to be created.
  525. </para>
  526. <para>
  527. Connection to the Smart Card reader and card take place as follows:
  528. <list type="bullet">
  529. <item>
  530. EstablishContext opens the connection to the reader.
  531. </item>
  532. <item>
  533. Connect powers the card if not already powered by another context.
  534. </item>
  535. <item>
  536. Disconnect does the action provided in the parameters.
  537. </item>
  538. <item>
  539. Reconnect applies the disposition provided in the parameters,
  540. and should be called if another context resets the card.
  541. </item>
  542. <item>
  543. ReleaseContext actually disconnects the connection to the reader
  544. but only if it is last context to be released.
  545. </item>
  546. </list>
  547. </para>
  548. This allows status calls from GetStatusChange to be made even
  549. when Connect has not been called, or disconnect has been called.
  550. (i.e. allows user to wait for card to be present in reader before Connect is called)
  551. <para>
  552. This API creates one card for each context, thus each context
  553. has a matching card and vice versa.
  554. If a Status call is required before Connect() is called,
  555. GetStatusChange(context, 0) can be used because the context
  556. only has access to the one card.
  557. Errors are not returned from the functions. Instead, GetError()
  558. is a new function to access the error from the most recent function call.
  559. </para>
  560. <para>
  561. Since there is only one reader and one card, many of the
  562. functions in the PC/SC Lite API are not implemented in the PC/SC Micro API.
  563. The following is a list of excluded functions and reasons for exclusion:
  564. <list type="bullet">
  565. <listheader>
  566. <term>
  567. Excluded functions
  568. </term>
  569. <description>List of excluded functions and reason for exclusion</description>
  570. </listheader>
  571. <item>
  572. GetReaderGroups: Only one reader
  573. </item>
  574. <item>
  575. GetReaders: Only one reader.
  576. </item>
  577. <item>
  578. FreeMemory: Micro Framework only supports C# which has its own garbage collector.
  579. </item>
  580. <item>
  581. GetAttrib: Only one reader, so attributes should be known
  582. </item>
  583. <item>
  584. SetAttrib: Only one reader, so attributes should be known
  585. </item>
  586. <item>
  587. SetTimeout: Function does not do anything in PC/SC Lite API
  588. </item>
  589. <item>
  590. CancelTransition: Function is considered bad coding technique in PC/SC Lite API
  591. </item>
  592. </list>
  593. </para>
  594. </remarks>
  595. </member>
  596. <member name="F:PCSCMicro.SCard.INFINITE">
  597. <summary>
  598. Infinite timeout constant
  599. </summary>
  600. <value>
  601. The value of this constant is 2147483647
  602. </value>
  603. </member>
  604. <member name="M:PCSCMicro.SCard.EstablishContext">
  605. <summary>
  606. Creates an SCardContext to open communication to the reader
  607. </summary>
  608. <errors>
  609. <para>
  610. SCARD_S_SUCCESS Successful
  611. </para>
  612. <para>
  613. SCARD_E_UNAVAILABLE_READER Unable to connect to reader
  614. </para>
  615. </errors>
  616. <example>
  617. <code>
  618. // Establish new Smart Card context
  619. SCardContext context = SCard.EstablishContext();
  620. </code>
  621. </example>
  622. <remarks>
  623. This function creates a communication context to the PC/SC Micro
  624. API, and creates room for corresponding SCardHandle.
  625. It also opens the COM port if not already done by another
  626. application and establishes connection to the reader if this is
  627. necessary (i.e. if the board is Teridian and not GemCore). This
  628. must be the first function called in a PC/SC application.
  629. </remarks>
  630. <returns>SCardContext created</returns>
  631. </member>
  632. <member name="M:PCSCMicro.SCard.ReleaseContext(PCSCMicro.SCardContext)">
  633. <summary>
  634. This function destroys context created by EstablishContext
  635. </summary>
  636. <errors>
  637. <para>
  638. SCARD_S_SUCCESS - Successful
  639. </para>
  640. <para>
  641. SCARD_E_INVALID_HANDLE Context is not valid
  642. </para>
  643. <para>
  644. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  645. </para>
  646. <para>
  647. SCARD_E_UNAVAILABLE_READER Reader currently unavailable due to running test
  648. </para>
  649. </errors>
  650. <example>
  651. <code>
  652. // Establish new Smart Card context
  653. SCardContext context = SCard.EstablishContext();
  654. ...
  655. // Release Smart Card context
  656. SCard.ReleaseContext(context);
  657. </code>
  658. </example>
  659. <remarks>
  660. This function destroys the communication context to
  661. the PC/SC Micro API created by EstablishContext().
  662. If the corresponding SCardHandle has not been disconnected,
  663. then Disconnect will be called with the corresponding
  664. card and SCardDisposition.LEAVE_CARD as parameters. If
  665. context is the last SCardContext, then he COM port is
  666. closed and the connection to the reader (in the case of
  667. Teridian board) is terminated. This must be the last
  668. function called in a PC/SC application as once this
  669. function is called, this SCardContext can no longer be used
  670. to communicate with the reader.
  671. </remarks>
  672. <param name="context">Context to be released</param>
  673. <returns>True if the context is successfully released,
  674. false otherwise</returns>
  675. </member>
  676. <member name="M:PCSCMicro.SCard.IsValidContext(PCSCMicro.SCardContext)">
  677. <summary>
  678. This function determines whether a context is valid
  679. </summary>
  680. <errors>
  681. <para>
  682. SCARD_S_SUCCESS - Successful
  683. </para>
  684. <para>
  685. SCARD_E_INVALID_HANDLE EstablishContext() has not yet been called
  686. </para>
  687. </errors>
  688. <example>
  689. <code>
  690. // Establish new Smart Card context
  691. SCardContext context = SCard.EstablishContext();
  692. ...
  693. // Check if context is valid, if so release it
  694. if(SCard.IsValidContext(context))
  695. {
  696. SCard.ReleaseContext(context);
  697. }
  698. </code>
  699. </example>
  700. <remarks>
  701. After a SCardContext has been created by EstablishContext(),
  702. it may become invalid if RemoveContext() is called.
  703. </remarks>
  704. <param name="context">Context of which to check validity</param>
  705. <returns>True if context is valid, false otherwise</returns>
  706. </member>
  707. <member name="M:PCSCMicro.SCard.GetStatusChange(PCSCMicro.SCardContext,System.Int32)">
  708. <summary>
  709. Blocks reader until a change in status occurs
  710. </summary>
  711. <remarks>
  712. This function blocks for a change in state to occur on the reader
  713. for a maximum blocking time of timeout or forever if timeout =
  714. INFINITE. The function will return immediately with the current
  715. state if timeout is 0 and will wait forever if timeout is
  716. INFINITE. During the timeout period, no other function will be
  717. able to access the reader unless Cancel is called. The format of
  718. the return object is the same as that of Status. A status change
  719. might be a card insertion or removal event, etc. This function
  720. assumes that if the user intends to call the Cancel function,
  721. then it will have created a new thread on which to run this
  722. function. The length of the sleep may need to be extended
  723. depending on the speed of the card reader.
  724. </remarks>
  725. <errors>
  726. <para>
  727. SCARD_S_SUCCESS Successful
  728. </para>
  729. <para>
  730. SCARD_E_INVALID_HANDLE Invalid Context
  731. </para>
  732. <para>
  733. SCARD_E_SHARING_VIOLATION Another application has blocked access to reader
  734. </para>
  735. <para>
  736. SCARD_E_INVALID_VALUE Timeout value is invalid
  737. </para>
  738. <para>
  739. SCARD_E_NOT_READY Another GetStatusChange() call has yet to complete
  740. </para>
  741. <para>
  742. SCARD_E_UNKNOWN_CARD Error occurred when checking card status
  743. </para>
  744. </errors>
  745. <example>
  746. <code>
  747. // Establish new Smart Card context
  748. SCardContext context = SCard.EstablishContext();
  749. // Get current Smart Card status
  750. SCardStatusReturn status = SCard.GetStatusChange(context, 0);
  751. // If card is not present or activated, wait for a change of status
  752. if(status.State != SCardState.PRESENT || status.State != SCardState.ACTIVATED)
  753. {
  754. status = SCard.GetStatusChange(context, SCard.INFINITE);
  755. }
  756. // Release Smart Card context
  757. SCard.ReleaseContext(context);
  758. </code>
  759. </example>
  760. <param name="context">Context to use to block reader</param>
  761. <param name="timeout">Length of time in milliseconds to block
  762. the reader if no status change occurs</param>
  763. <returns>SCardStatusReturn object containing the status of the
  764. card, the protocol used by the context, and the ATR of the card.
  765. If the first is an error, then the protocol is T = 0 and the ATR
  766. is set to null</returns>
  767. </member>
  768. <member name="M:PCSCMicro.SCard.Cancel(PCSCMicro.SCardContext)">
  769. <summary>
  770. Cancels previous call to GetStatusChange
  771. </summary>
  772. <errors>
  773. <para>
  774. SCARD_S_SUCCESS Successful
  775. </para>
  776. <para>
  777. SCARD_E_INVALID_HANDLE Invalid Context
  778. </para>
  779. <para>
  780. SCARD_E_INVALID_HANDLE GetStatusChange() has not been called
  781. </para>
  782. <para>
  783. SCARD_E_SHARING_VIOLATION Another application made previous GetStatusChange() call
  784. </para>
  785. </errors>
  786. <example>
  787. <code>
  788. // Establish new Smart Card context
  789. SCardContext context = SCard.EstablishContext();
  790. // Get current Smart Card status
  791. SCardStatusReturn status = SCard.GetStatusChange(context, 0);
  792. // If card is not present or activated, wait for a change of status
  793. if(status.State != SCardState.PRESENT || status.State != SCardState.ACTIVATED)
  794. {
  795. ...Create new Thread which calls GetStatusChange(context, ...)...
  796. // If status change takes too long, cancel status change
  797. if(...takes too much time...)
  798. {
  799. SCard.Cancel(context);
  800. }
  801. }
  802. // Release Smart Card context
  803. SCard.ReleaseContext(context);
  804. </code>
  805. </example>
  806. <remarks>
  807. This function cancels all pending blocking requests on the
  808. GetStatusChange function. In order for this function to
  809. work properly, GetStatusChange must have been called on
  810. a separate Thread.
  811. </remarks>
  812. <param name="context">Context which called GetStatusChange</param>
  813. </member>
  814. <member name="M:PCSCMicro.SCard.Connect(PCSCMicro.SCardContext,PCSCMicro.SCardShareMode,PCSCMicro.SCardProtocol)">
  815. <summary>
  816. Activates card and creates handle associated with context
  817. </summary>
  818. <errors>
  819. <para>
  820. SCARD_S_SUCCESS Successful
  821. </para>
  822. <para>
  823. SCARD_E_INVALID_HANDLE Invalid Context
  824. </para>
  825. <para>
  826. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  827. </para>
  828. <para>
  829. SCARD_E_INVALID_VALUE Invalid protocol or share mode passed as parameter
  830. </para>
  831. <para>
  832. SCARD_E_NO_SMARTCARD No Smart Card insterted
  833. </para>
  834. <para>
  835. SCARD_E_UNAVAILABLE_READER Reader currently unavailable due to running test
  836. </para>
  837. <para>
  838. SCARD_W_UNRESPONSIVE_CARD No response received from Smart Card
  839. </para>
  840. </errors>
  841. <example>
  842. <code>
  843. // Establish new Smart Card context
  844. SCardContext context = SCard.EstablishContext();
  845. // Connect Smart Card
  846. SCardHandle card = SCard.Connect(context, SCardHandle.SHARED, SCardProtocol.T0);
  847. // Release Smart Card context
  848. SCard.ReleaseContext(context);
  849. </code>
  850. </example>
  851. <remarks>
  852. This function establishes a connection to the reader. The first
  853. connection will power up the card. This command is used to
  854. activate, whereas EstablishContext actually connects to the
  855. reader. The reason for this is to allow GetStatusChange to be
  856. accessed before Connect is called to allow connection to wait
  857. for a card to be inserted.
  858. </remarks>
  859. <param name="context">Context with which to associate
  860. the new SCardHandle</param>
  861. <param name="share">Share mode to be used by Handle</param>
  862. <param name="protocol">Protocol to be used by Handle</param>
  863. <returns>Dummy SCardHandle object with card info</returns>
  864. </member>
  865. <member name="M:PCSCMicro.SCard.Reconnect(PCSCMicro.SCardHandle,PCSCMicro.SCardShareMode,PCSCMicro.SCardProtocol,PCSCMicro.SCardDisposition)">
  866. <summary>
  867. Resets card/reader if necessary, perfoms disposition
  868. </summary>
  869. <errors>
  870. <para>
  871. SCARD_S_SUCCESS Successful
  872. </para>
  873. <para>
  874. SCARD_E_INVALID_HANDLE Invalid card
  875. </para>
  876. <para>
  877. SCARD_E_INVALID_VALUE Invalid value of protocol, share mode, or disposition
  878. </para>
  879. <para>
  880. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  881. </para>
  882. <para>
  883. SCARD_E_NO_SMARTCARD Cannot carry through disposition because Smart Card was removed
  884. </para>
  885. <para>
  886. SCARD_E_SHARING_VIOLATION Another application has blocked access to reader
  887. </para>
  888. <para>
  889. SCARD_E_UNAVAILABLE_READER Reader currently unavailable due to running test
  890. </para>
  891. </errors>
  892. <example>
  893. <code>
  894. // Establish Smart Card context
  895. SCardContext context = SCard.EstablishContext();
  896. // Connect Smart Card
  897. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  898. ... SCardError.SCARD_W_RESET_CARD returns after some function call...
  899. // Reconnect to Smart Card
  900. SCard.Reconnect(card, SCardShareMode.SHARED, SCardProtocol.T0, SCardDisposition.RESET_CARD);
  901. // Release Smart Card context
  902. SCard.ReleaseContext(context);
  903. </code>
  904. </example>
  905. <remarks>
  906. This function reconnects the uFW to the connection made through
  907. Connect. This function carries through the action given as
  908. disposition. Thus function should be called if
  909. SCardError.SCARD_W_RESET_CARD is ever returned.
  910. </remarks>
  911. <param name="card">SCardHandle which was reset</param>
  912. <param name="share">Share mode to be used by Handle</param>
  913. <param name="protocol">Protocol to be used by Handle</param>
  914. <param name="disposition">Disposition to be used when
  915. reconnecting</param>
  916. <returns>True if successfully reconnected, false otherwise</returns>
  917. </member>
  918. <member name="M:PCSCMicro.SCard.Disconnect(PCSCMicro.SCardHandle,PCSCMicro.SCardDisposition)">
  919. <summary>
  920. Destroys handle created by Connect, performs disposition
  921. </summary>
  922. <errors>
  923. <para>
  924. SCARD_S_SUCCESS Successful
  925. </para>
  926. <para>
  927. SCARD_E_INVALID_HANDLE Invalid card
  928. </para>
  929. <para>
  930. SCARD_E_INVALID_VALUE Invalid value of disposition
  931. </para>
  932. <para>
  933. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  934. </para>
  935. <para>
  936. SCARD_E_NO_SMARTCARD Cannot carry through disposition because Smart Card was removed
  937. </para>
  938. </errors>
  939. <example>
  940. <code>
  941. // Establish new Smart Card context
  942. SCardContext context = SCard.EstablishContext();
  943. // Connect Smart Card
  944. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  945. // Disconnect Smart Card
  946. SCard.Disconnect(card, SCardDisposition.UNPOWER_CARD);
  947. // Release Smart Card context
  948. SCard.ReleaseContext();
  949. </code>
  950. </example>
  951. <remarks>
  952. This function makes it so that the SCardHandle being destroyed
  953. can no longer be used in function calls, even if Reconnect is
  954. called. Furthermore, it performs whatever action is in the
  955. disposition parameter. For possible disposition values, see
  956. SCardDisposition.
  957. </remarks>
  958. <param name="card">SCardHandle to be disconnected</param>
  959. <param name="disposition">Disposition to be used when
  960. disconnecting</param>
  961. </member>
  962. <member name="M:PCSCMicro.SCard.Status(PCSCMicro.SCardHandle)">
  963. <summary>
  964. Returns current status, protocol for card, and Smart Card's ATR
  965. </summary>
  966. <errors>
  967. <para>
  968. SCARD_S_SUCCESS Successful
  969. </para>
  970. <para>
  971. SCARD_E_INVALID_HANDLE Invalid card
  972. </para>
  973. <para>
  974. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  975. </para>
  976. <para>
  977. SCARD_E_SHARING_VIOLATION Another application has blocked access to reader
  978. </para>
  979. <para>
  980. SCARD_E_UNKNOWN_CARD Error occurred when checking card status
  981. </para>
  982. </errors>
  983. <example>
  984. <code>
  985. // Establish new Smart Card context
  986. SCardContext context = SCard.EstablishContext();
  987. // Connect Smart Card
  988. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  989. // Get current Smart Card status
  990. SCardStatusReturn status = SCard.Status(card);
  991. // Disconnect Smart Card
  992. SCard.Disconnect(card, SCardDisposition.UNPOWER_CARD);
  993. // Release Smart Card context
  994. SCard.ReleaseContext(context);
  995. </code>
  996. </example>
  997. <remarks>
  998. This function returns the current status of the reader connected to by context.
  999. The current state, protocol, and ATR will all be returned from a Status() call.
  1000. If Connect() has not yet been called, then the ATR returned will be null, and
  1001. the protocol returned will be SCardProtocol.T0.
  1002. </remarks>
  1003. <param name="card">SCardHandle of which to check status</param>
  1004. <returns>SCardStatusReturn object containing the status of the
  1005. card, the protocol used by the context, and the ATR of the card.
  1006. If the first is an error, then the protocol is T = 0 and the ATR
  1007. is set to null</returns>
  1008. </member>
  1009. <member name="M:PCSCMicro.SCard.BeginTransaction(PCSCMicro.SCardHandle)">
  1010. <summary>
  1011. Block all other applications from accessing reader
  1012. </summary>
  1013. <errors>
  1014. <para>
  1015. SCARD_S_SUCCESS Successful
  1016. </para>
  1017. <para>
  1018. SCARD_E_INVALID_HANDLE Invalid card
  1019. </para>
  1020. <para>
  1021. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  1022. </para>
  1023. <para>
  1024. SCARD_E_SHARING_VIOLATION Another application has share mode exlusive
  1025. </para>
  1026. <para>
  1027. SCARD_W_RESET_CARD Card was reset by another application
  1028. </para>
  1029. </errors>
  1030. <example>
  1031. <code>
  1032. // Establish new Smart Card context
  1033. SCardContext context = SCard.EstablishContext();
  1034. // Connect Smart Card
  1035. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  1036. // Begin Smart Card transaction
  1037. SCard.BeginTransaction(card);
  1038. </code>
  1039. </example>
  1040. <remarks>This function establishes a temporary exclusive access mode
  1041. for doing a series of commands or transaction. You might want to use
  1042. this when you are selecting a few files and then writing a large
  1043. file so you can make sure that another application will not change
  1044. the current file. If another application has SCardShareMode.EXCLUSIVE
  1045. on this reader or this application is in SCardShareMode.EXCLUSIVE
  1046. there will be no action taken. If another application has a lock on
  1047. this reader using BeginTransaction, then this function will wait
  1048. until the reader is free.
  1049. </remarks>
  1050. <param name="card">SCardHandle to use to place block on reader</param>
  1051. </member>
  1052. <member name="M:PCSCMicro.SCard.EndTransaction(PCSCMicro.SCardHandle,PCSCMicro.SCardDisposition)">
  1053. <summary>
  1054. Remove block that was created by BeginTransaction
  1055. </summary>
  1056. <errors>
  1057. <para>
  1058. SCARD_S_SUCCESS Successful
  1059. </para>
  1060. <para>
  1061. SCARD_E_INVALID_HANDLE Invalid card
  1062. </para>
  1063. <para>
  1064. SCARD_E_INVALID_VALUE Provided disposition was invalid
  1065. </para>
  1066. <para>
  1067. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  1068. </para>
  1069. <para>
  1070. SCARD_E_NO_SMARTCARD Cannot carry through disposition because Smart Card was removed
  1071. </para>
  1072. <para>
  1073. SCARD_E_SHARING_VIOLATION Another application has a lock on the reader
  1074. </para>
  1075. <para>
  1076. SCARD_W_RESET_CARD Card was reset by another application
  1077. </para>
  1078. <para>
  1079. SCARD_E_ INVALID_TARGET BeginTransaction was never called
  1080. </para>
  1081. </errors>
  1082. <example>
  1083. <code>
  1084. // Establish new Smart Card context
  1085. SCardContext context = SCard.EstablishContext();
  1086. // Connect Smart Card
  1087. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  1088. // Begin Smart Card transaction
  1089. SCard.BeginTransaction(card);
  1090. // End Smart Card transaction
  1091. SCard.EndTransaction(card, SCardDisposition.LEAVE_CARD);
  1092. </code>
  1093. </example>
  1094. <remarks>This function ends a previously begun transaction. The
  1095. calling application must be the owner of the previously begun
  1096. transaction or an error will occur. Following the unlocking, the
  1097. disposition action takes place on the card.
  1098. </remarks>
  1099. <param name="card">SCardHandle which placed block on reader</param>
  1100. <param name="disposition">Disposition to be used when
  1101. removing block</param>
  1102. </member>
  1103. <member name="M:PCSCMicro.SCard.Transmit(PCSCMicro.SCardHandle,PCSCMicro.SCardProtocol,System.String)">
  1104. <summary>
  1105. Sends APDU to card and returns cards response
  1106. </summary>
  1107. <errors>
  1108. <para>
  1109. SCARD_S_SUCCESS Successful
  1110. </para>
  1111. <para>
  1112. SCARD_E_INVALID_HANDLE Invalid card
  1113. </para>
  1114. <para>
  1115. SCARD_E_INVALID_VALUE Provided protocol was invalid
  1116. </para>
  1117. <para>
  1118. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  1119. </para>
  1120. <para>
  1121. SCARD_E_NO_SMARTCARD Cannot change protocol because Smart Card was removed
  1122. </para>
  1123. <para>
  1124. SCARD_E_NOT_TRANSACTED Error occurred on APDU transmit
  1125. </para>
  1126. <para>
  1127. SCARD_E_SHARING_VIOLATION Another application has a lock on the reader
  1128. </para>
  1129. <para>
  1130. SCARD_W_RESET_CARD Card was reset by another application
  1131. </para>
  1132. <para>
  1133. SCARD_E_UNAVAILABLE_READER Reader currently unavailable due to running test
  1134. </para>
  1135. <para>
  1136. SCARD_W_UNRESPONSIVE_CARD No response received from Smart Card
  1137. </para>
  1138. </errors>
  1139. <example>
  1140. <code>
  1141. // Establish new Smart Card context
  1142. SCardContext context = SCard.EstablishContext();
  1143. // Connect Smart Card
  1144. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  1145. // Create APDU command string
  1146. string APDU = "00A40000020001";
  1147. // Begin Smart Card transaction
  1148. SCard.BeginTransaction(card);
  1149. // Transmit APDU to Smart Card
  1150. string response = SCard.Transmit(card, SCardProtocol.T0, APDU);
  1151. // End Smart Card transaction
  1152. SCard.EndTransaction(card, SCardDisposition.LEAVE_CARD);
  1153. // Disconnect Smart Card
  1154. SCard.Disconnect(card, SCardDisposition.RESET_CARD);
  1155. // Release Smart Card context
  1156. SCard.ReleaseContext(context);
  1157. </code>
  1158. </example>
  1159. <remarks>This function sends an APDU to the smartcard contained in
  1160. the reader connected to by SCardConnect. The card responds from
  1161. the APDU and this response is returned as a string. This function
  1162. sets the protocol before sending the APDU. </remarks>
  1163. <param name="card">SCardHandle to use to transmit APDU</param>
  1164. <param name="protocol">Protocol to use during transmission</param>
  1165. <param name="APDU">APDU to send to card</param>
  1166. <returns>Response APDU from the card</returns>
  1167. </member>
  1168. <member name="M:PCSCMicro.SCard.Control(PCSCMicro.SCardHandle,System.String,System.String)">
  1169. <summary>
  1170. Send command directly to IFD to be processed by reader
  1171. </summary>
  1172. <errors>
  1173. <para>
  1174. SCARD_S_SUCCESS Successful
  1175. </para>
  1176. <para>
  1177. SCARD_E_INVALID_HANDLE Invalid card
  1178. </para>
  1179. <para>
  1180. SCARD_E_NOT_READY Waiting for GetStatusChange() to complete
  1181. </para>
  1182. <para>
  1183. SCARD_E_SHARING_VIOLATION Another application has a lock on the reader
  1184. </para>
  1185. <para>
  1186. SCARD_E_NOT_TRANSACTED Return value from reader is null
  1187. </para>
  1188. <para>
  1189. SCARD_E_UNAVAILABLE_READER Reader currently unavailable due to running test
  1190. </para>
  1191. </errors>
  1192. <example>
  1193. <code>
  1194. // Establish new Smart Card context
  1195. SCardContext context = SCard.EstablishContext();
  1196. // Connect Smart Card
  1197. SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
  1198. // Create command strings
  1199. string code = ... string representing valid command code...
  1200. string message = ... string representing valid data...
  1201. /

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