/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
- <?xml version="1.0"?>
- <doc>
- <assembly>
- <name>PCSCMicro</name>
- </assembly>
- <members>
- <member name="T:PCSCMicro.HexStringDecoder">
- <summary>
- This class does conversions for the API
- </summary>
- <remarks>
- Most of the conversions involve hexidecimal notation strings
- or bytes, however there is a conversion from a uint to a byte
- array also which is used by BigInteger.
- </remarks>
- </member>
- <member name="M:PCSCMicro.HexStringDecoder.ByteToHex(System.Byte)">
- <summary>
- Converts a byte to hex string of length 2.
- </summary>
- <example>
- b = 204 = 0xCC, is decoded into "CC".
- </example>
- <remarks>
- Used for values from 0 to 0xFF = 255.
- </remarks>
- <param name="b">Value to be converted to hex</param>
- <returns>Hex string representation of b</returns>
- </member>
- <member name="M:PCSCMicro.HexStringDecoder.HexStringToInt(System.String)">
- <summary>
- Converts hex string of length 2 to int.
- </summary>
- <remarks>
- Used for values from 0 to 0xFF = 255.
- </remarks>
- <example>
- hexStr = "CC" is decoded into int 204 = 0xCC.
- </example>
- <param name="HexStr">Hex string to be converted to decimal.</param>
- <returns>Decimal representation of hexStr</returns>
- </member>
- <member name="M:PCSCMicro.HexStringDecoder.StringToByteArray(System.String)">
- <summary>
- Converts hex string of any length to a Byte array
- with same hex representation.
- </summary>
- <example>
- HexStr = C0AAC0C0CC80..., is decoded into
- byte array [ 0xC0, 0xAA, 0xC0, 0xC0, 0xCC, 0x80, ...].
- </example>
- <param name="HexStr">Hex string to be converted to decimal
- byte array</param>
- <returns>Decimal byte array representing HexStr</returns>
- </member>
- <member name="M:PCSCMicro.HexStringDecoder.Dec2Hex(System.UInt32)">
- <summary>
- Converts a uint number to equivalent hex value.
- </summary>
- <remarks>
- Used for values of up to 4294967295 = 0xFFFFFFFF.
- </remarks>
- <example>
- x = 4275878401 = 0xFEDCBA01 is decoded to "FEDCBA01".
- </example>
- <param name="x">Decimal value to convert to hex string</param>
- <returns>Hex string representing x</returns>
- </member>
- <member name="M:PCSCMicro.HexStringDecoder.uintToByteArray(System.UInt32)">
- <summary>
- Converts a uint number to equivalent byte array.
- </summary>
- <remarks>
- Used for values of up to 4294967295 = 0xFFFFFFFF.
- </remarks>
- <example>
- x = 4275878401 = 0xFEDCBA01 is decoded to [0xFE, 0xDC, 0xBA, 0x01].
- </example>
- <param name="x">uint to convert to ByteArray</param>
- <returns>Byte array of length 4 which when concatenated together
- has the same value as x</returns>
- </member>
- <member name="M:PCSCMicro.HexStringDecoder.ByteArrayToString(System.Byte[],System.Int32)">
- <summary>
- Converts a byte array to equivalent hex string.
- </summary>
- <example>
- ByteArray = [ 0xC0, 0xAA, 0xC0, 0xC0, 0xCC, 0x80]
- and bytecount = 6 is decoded to HexStr = "C0AAC0C0CC80".
- </example>
- <param name="ByteArray">Decimal byte array to be
- converted to a hex string</param>
- <param name="bytecount">Number of bytes from the array
- to be converted</param>
- <returns>Hex string representation of the first bytecount
- cells in ByteArray</returns>
- </member>
- <member name="T:PCSCMicro.SCardError">
- <summary>
- Error types for SCard
- </summary>
- <remarks>
- Some error values are never used. These were included
- in order to keep the PC/SC Micro API compatible
- with the PC/SC Lite API. They were also kept in to
- allow additions to be made to make functionality
- closer to that of the PC/SC Lite API.
- </remarks>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_S_SUCCESS">
- <summary>
- Command successful
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_CANCELLED">
- <summary>
- Command cancelled
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_CANT_DISPOSE">
- <summary>
- Cannot dispose handle
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_VALUE">
- <summary>
- Invalid value given
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_HANDLE">
- <summary>
- Invalid handle given
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NO_MEMORY">
- <summary>
- Not enough memory
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_UNSUPPORTED_INTERFACE">
- <summary>
- Interface not supported
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_UNSUPPORTED_FEATURE">
- <summary>
- Feature not supported
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NOTIMPL">
- <summary>
- ???
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_UNSUPPORTED_FUNCTION">
- <summary>
- Function not supported
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_INSUFFICIENT_BUFFER">
- <summary>
- Insufficient buffer
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_ATR">
- <summary>
- Invalid ATR
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NO_SERVICE">
- <summary>
- Service not available
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_PARAMETER">
- <summary>
- Invalid parameter given
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_INVALID_TARGET">
- <summary>
- Invalid target given
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_SERVICE_STOPPED">
- <summary>
- Service was stopped
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_F_COMM_ERROR">
- <summary>
- RPC transport error
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_F_INTERNAL_ERROR">
- <summary>
- Internal error
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_UNKNOWN_READER">
- <summary>
- Unknown error
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_TIMEOUT">
- <summary>
- Command timeout
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_SHARING_VIOLATION">
- <summary>
- Sharing violation
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NO_SMARTCARD">
- <summary>
- No smart card inserted
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_UNKNOWN_CARD">
- <summary>
- Unknown card
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NOT_READY">
- <summary>
- Subsystem not readey
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_SYSTEM_CANCELLED">
- <summary>
- System cancelled
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NOT_TRANSACTED">
- <summary>
- Transaction failed
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_READER_UNAVAILABLE">
- <summary>
- Reader is unavailable
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_F_UNKNOWN_ERROR">
- <summary>
- Unknown error
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_W_UNSUPPORTED_CARD">
- <summary>
- Card is not supported
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_W_UNRESPONSIVE_CARD">
- <summary>
- Card is unresponsive
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_W_UNPOWERED_CARD">
- <summary>
- Card is unpowered
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_W_RESET_CARD">
- <summary>
- Card was reset
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_W_REMOVED_CARD">
- <summary>
- Card was removed
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_W_INSERTED_CARD">
- <summary>
- Card was inserted
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_READER_UNSUPPORTED">
- <summary>
- Reader is unsupported
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_CARD_UNSUPPORTED">
- <summary>
- Card is unsupported
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_DUPLICATE_READER">
- <summary>
- Reader already exists
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_PCI_TOO_SMALL">
- <summary>
- PCI struct too small
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_PROTO_MISMATCH">
- <summary>
- Card protocol mismatch
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_F_WAITED_TOO_LONG">
- <summary>
- Waited too long
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardError.SCARD_E_NO_READERS_AVAILABLE">
- <summary>
- Cannot find a smart card reader
- </summary>
- </member>
- <member name="T:PCSCMicro.SCardProtocol">
- <summary>
- Protocols for SCard
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardProtocol.T0">
- <summary>
- T = 0 Protocol
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardProtocol.T1">
- <summary>
- T = 1 Protocol
- </summary>
- </member>
- <member name="T:PCSCMicro.SCardDisposition">
- <summary>
- Actions to be taken in regards to deactivating smart card
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardDisposition.LEAVE_CARD">
- <summary>
- Do nothing to card
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardDisposition.RESET_CARD">
- <summary>
- Reset the card
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardDisposition.UNPOWER_CARD">
- <summary>
- Turn off the card
- </summary>
- </member>
- <member name="T:PCSCMicro.SCardState">
- <summary>
- States in which the card can be
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardState.ABSENT">
- <summary>
- Card is absent
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardState.PRESENT">
- <summary>
- Card is present
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardState.ACTIVATED">
- <summary>
- Card is activated
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardState.ERROR">
- <summary>
- Error has occurred, card is in error state
- </summary>
- </member>
- <member name="T:PCSCMicro.SCardShareMode">
- <summary>
- Share modes for readers
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardShareMode.SHARED">
- <summary>
- Handle is allowing other handles to share card and reader
- </summary>
- </member>
- <member name="F:PCSCMicro.SCardShareMode.EXCLUSIVE">
- <summary>
- Handle has exclusive rights to card and reader
- </summary>
- </member>
- <member name="T:PCSCMicro.SCardHandle">
- <summary>
- Class representing the smart card and reader
- </summary>
- </member>
- <member name="M:PCSCMicro.SCardHandle.#ctor">
- <summary>
- Constructor
- </summary>
- </member>
- <member name="M:PCSCMicro.SCardHandle.Connect(PCSCMicro.SCardShareMode,PCSCMicro.SCardProtocol,System.String)">
- <summary>
- Sets variables, changes state to connected
- </summary>
- <param name="share">Share mode to be used by Handle</param>
- <param name="proto">Protocol to be used by Handle</param>
- <param name="Atr">ATR of the card in the reader</param>
- </member>
- <member name="M:PCSCMicro.SCardHandle.Disconnect">
- <summary>
- Changes to disconnected state
- </summary>
- </member>
- <member name="P:PCSCMicro.SCardHandle.Connected">
- <summary>
- Gets whether card is connected
- </summary>
- <returns>True if card is connected, false otherwise</returns>
- </member>
- <member name="P:PCSCMicro.SCardHandle.Protocol">
- <summary>
- Gets the protocol used by this SCardHandle
- </summary>
- <returns>Protocol used by this SCardHandle</returns>
- </member>
- <member name="P:PCSCMicro.SCardHandle.ATR">
- <summary>
- Gets the ATR associated with the smart card
- </summary>
- <returns>ATR associated with the smart card</returns>
- </member>
- <member name="P:PCSCMicro.SCardHandle.ShareMode">
- <summary>
- Gets the share mode used by this SCardHandle
- </summary>
- <returns>Share mode used by this SCardHandle</returns>
- </member>
- <member name="T:PCSCMicro.SCardContext">
- <summary>
- Class representing a context
- </summary>
- <remarks>
- A context in the standard PC/SC Lite API acts as a pointer
- to the resource manager. Since there is no resource manager,
- a context in the PC/SC Micro API acts as a way of accessing
- the rest of the functions in the API. An application must first
- establish a context before doing anything else with the API. A
- context in this definition can only be established, be released,
- or check if it is valid.
- </remarks>
- </member>
- <member name="M:PCSCMicro.SCardContext.#ctor">
- <summary>
- Constructor
- </summary>
- </member>
- <member name="M:PCSCMicro.SCardContext.Establish">
- <summary>
- Sets context as valid
- </summary>
- </member>
- <member name="M:PCSCMicro.SCardContext.Release">
- <summary>
- Sets context as invalid
- </summary>
- </member>
- <member name="P:PCSCMicro.SCardContext.IsValid">
- <summary>
- Gets whether SCardContext is valid
- </summary>
- <returns>True if SCardContext is valid, false otherwise</returns>
- </member>
- <member name="T:PCSCMicro.SCardStatusReturn">
- <summary>
- Class representing return of Status and GetStatusChange
- </summary>
- </member>
- <member name="M:PCSCMicro.SCardStatusReturn.#ctor(PCSCMicro.SCardState,System.String,PCSCMicro.SCardProtocol)">
- <summary>
- Constructor
- </summary>
- <param name="status">Status of card</param>
- <param name="Atr">ATR of card</param>
- <param name="proto">Protocol used with SCardHandle</param>
- </member>
- <member name="M:PCSCMicro.SCardStatusReturn.Equals(PCSCMicro.SCardStatusReturn)">
- <summary>
- Equals method for SCardStatusReturn objects
- </summary>
- <param name="value">Second SCardStatusReturn object</param>
- <returns>True if two SCardStatusReturn objects are equal,
- false if second object is not a SCardStatusReturn object
- or if they are not equal</returns>
- </member>
- <member name="P:PCSCMicro.SCardStatusReturn.ATR">
- <summary>
- Gets the ATR associated with the smart card
- </summary>
- <returns>ATR associated with the smart card</returns>
- </member>
- <member name="P:PCSCMicro.SCardStatusReturn.Protocol">
- <summary>
- Gets the protocol used by this SCardHandle
- </summary>
- <returns>Protocol used by this SCardHandle</returns>
- </member>
- <member name="P:PCSCMicro.SCardStatusReturn.State">
- <summary>
- Gets the status of the card
- </summary>
- <returns>Status of the card</returns>
- </member>
- <member name="T:PCSCMicro.SCard">
- <summary>
- This class is used to call all of the PC/SC Micro API functions
- </summary>
- <remarks>
- <para>
- This API assumes a working version of Device.cs
- exists in the project with all of the necessary functions.
- It was created to be used on the Teridian 73S1209F eval board
- and the GemCore Serial Lite Pro eval board. The API can be ported
- onto other reader chips if a Device.cs file is created for them that
- is a child of the Reader.cs class. All of the public functions are
- static, so no SCard object needs to be created.
- </para>
- <para>
- Connection to the Smart Card reader and card take place as follows:
- <list type="bullet">
- <item>
- EstablishContext opens the connection to the reader.
- </item>
- <item>
- Connect powers the card if not already powered by another context.
- </item>
- <item>
- Disconnect does the action provided in the parameters.
- </item>
- <item>
- Reconnect applies the disposition provided in the parameters,
- and should be called if another context resets the card.
- </item>
- <item>
- ReleaseContext actually disconnects the connection to the reader
- but only if it is last context to be released.
- </item>
- </list>
- </para>
- This allows status calls from GetStatusChange to be made even
- when Connect has not been called, or disconnect has been called.
- (i.e. allows user to wait for card to be present in reader before Connect is called)
- <para>
- This API creates one card for each context, thus each context
- has a matching card and vice versa.
- If a Status call is required before Connect() is called,
- GetStatusChange(context, 0) can be used because the context
- only has access to the one card.
- Errors are not returned from the functions. Instead, GetError()
- is a new function to access the error from the most recent function call.
- </para>
- <para>
- Since there is only one reader and one card, many of the
- functions in the PC/SC Lite API are not implemented in the PC/SC Micro API.
- The following is a list of excluded functions and reasons for exclusion:
- <list type="bullet">
- <listheader>
- <term>
- Excluded functions
- </term>
- <description>List of excluded functions and reason for exclusion</description>
- </listheader>
- <item>
- GetReaderGroups: Only one reader
- </item>
- <item>
- GetReaders: Only one reader.
- </item>
- <item>
- FreeMemory: Micro Framework only supports C# which has its own garbage collector.
- </item>
- <item>
- GetAttrib: Only one reader, so attributes should be known
- </item>
- <item>
- SetAttrib: Only one reader, so attributes should be known
- </item>
- <item>
- SetTimeout: Function does not do anything in PC/SC Lite API
- </item>
- <item>
- CancelTransition: Function is considered bad coding technique in PC/SC Lite API
- </item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="F:PCSCMicro.SCard.INFINITE">
- <summary>
- Infinite timeout constant
- </summary>
- <value>
- The value of this constant is 2147483647
- </value>
- </member>
- <member name="M:PCSCMicro.SCard.EstablishContext">
- <summary>
- Creates an SCardContext to open communication to the reader
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_UNAVAILABLE_READER – Unable to connect to reader
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- </code>
- </example>
- <remarks>
- This function creates a communication context to the PC/SC Micro
- API, and creates room for corresponding SCardHandle.
- It also opens the COM port if not already done by another
- application and establishes connection to the reader if this is
- necessary (i.e. if the board is Teridian and not GemCore). This
- must be the first function called in a PC/SC application.
- </remarks>
- <returns>SCardContext created</returns>
- </member>
- <member name="M:PCSCMicro.SCard.ReleaseContext(PCSCMicro.SCardContext)">
- <summary>
- This function destroys context created by EstablishContext
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS - Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Context is not valid
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_UNAVAILABLE_READER – Reader currently unavailable due to running test
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- ...
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <remarks>
- This function destroys the communication context to
- the PC/SC Micro API created by EstablishContext().
- If the corresponding SCardHandle has not been disconnected,
- then Disconnect will be called with the corresponding
- card and SCardDisposition.LEAVE_CARD as parameters. If
- context is the last SCardContext, then he COM port is
- closed and the connection to the reader (in the case of
- Teridian board) is terminated. This must be the last
- function called in a PC/SC application as once this
- function is called, this SCardContext can no longer be used
- to communicate with the reader.
- </remarks>
- <param name="context">Context to be released</param>
- <returns>True if the context is successfully released,
- false otherwise</returns>
- </member>
- <member name="M:PCSCMicro.SCard.IsValidContext(PCSCMicro.SCardContext)">
- <summary>
- This function determines whether a context is valid
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS - Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – EstablishContext() has not yet been called
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- ...
- // Check if context is valid, if so release it
- if(SCard.IsValidContext(context))
- {
- SCard.ReleaseContext(context);
- }
- </code>
- </example>
- <remarks>
- After a SCardContext has been created by EstablishContext(),
- it may become invalid if RemoveContext() is called.
- </remarks>
- <param name="context">Context of which to check validity</param>
- <returns>True if context is valid, false otherwise</returns>
- </member>
- <member name="M:PCSCMicro.SCard.GetStatusChange(PCSCMicro.SCardContext,System.Int32)">
- <summary>
- Blocks reader until a change in status occurs
- </summary>
- <remarks>
- This function blocks for a change in state to occur on the reader
- for a maximum blocking time of timeout or forever if timeout =
- INFINITE. The function will return immediately with the current
- state if timeout is 0 and will wait forever if timeout is
- INFINITE. During the timeout period, no other function will be
- able to access the reader unless Cancel is called. The format of
- the return object is the same as that of Status. A status change
- might be a card insertion or removal event, etc. This function
- assumes that if the user intends to call the Cancel function,
- then it will have created a new thread on which to run this
- function. The length of the sleep may need to be extended
- depending on the speed of the card reader.
- </remarks>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid Context
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has blocked access to reader
- </para>
- <para>
- SCARD_E_INVALID_VALUE – Timeout value is invalid
- </para>
- <para>
- SCARD_E_NOT_READY – Another GetStatusChange() call has yet to complete
- </para>
- <para>
- SCARD_E_UNKNOWN_CARD – Error occurred when checking card status
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Get current Smart Card status
- SCardStatusReturn status = SCard.GetStatusChange(context, 0);
- // If card is not present or activated, wait for a change of status
- if(status.State != SCardState.PRESENT || status.State != SCardState.ACTIVATED)
- {
- status = SCard.GetStatusChange(context, SCard.INFINITE);
- }
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <param name="context">Context to use to block reader</param>
- <param name="timeout">Length of time in milliseconds to block
- the reader if no status change occurs</param>
- <returns>SCardStatusReturn object containing the status of the
- card, the protocol used by the context, and the ATR of the card.
- If the first is an error, then the protocol is T = 0 and the ATR
- is set to null</returns>
- </member>
- <member name="M:PCSCMicro.SCard.Cancel(PCSCMicro.SCardContext)">
- <summary>
- Cancels previous call to GetStatusChange
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid Context
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – GetStatusChange() has not been called
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application made previous GetStatusChange() call
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Get current Smart Card status
- SCardStatusReturn status = SCard.GetStatusChange(context, 0);
- // If card is not present or activated, wait for a change of status
- if(status.State != SCardState.PRESENT || status.State != SCardState.ACTIVATED)
- {
- ...Create new Thread which calls GetStatusChange(context, ...)...
- // If status change takes too long, cancel status change
- if(...takes too much time...)
- {
- SCard.Cancel(context);
- }
- }
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <remarks>
- This function cancels all pending blocking requests on the
- GetStatusChange function. In order for this function to
- work properly, GetStatusChange must have been called on
- a separate Thread.
- </remarks>
- <param name="context">Context which called GetStatusChange</param>
- </member>
- <member name="M:PCSCMicro.SCard.Connect(PCSCMicro.SCardContext,PCSCMicro.SCardShareMode,PCSCMicro.SCardProtocol)">
- <summary>
- Activates card and creates handle associated with context
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid Context
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_INVALID_VALUE – Invalid protocol or share mode passed as parameter
- </para>
- <para>
- SCARD_E_NO_SMARTCARD – No Smart Card insterted
- </para>
- <para>
- SCARD_E_UNAVAILABLE_READER – Reader currently unavailable due to running test
- </para>
- <para>
- SCARD_W_UNRESPONSIVE_CARD – No response received from Smart Card
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardHandle.SHARED, SCardProtocol.T0);
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <remarks>
- This function establishes a connection to the reader. The first
- connection will power up the card. This command is used to
- activate, whereas EstablishContext actually connects to the
- reader. The reason for this is to allow GetStatusChange to be
- accessed before Connect is called to allow connection to wait
- for a card to be inserted.
- </remarks>
- <param name="context">Context with which to associate
- the new SCardHandle</param>
- <param name="share">Share mode to be used by Handle</param>
- <param name="protocol">Protocol to be used by Handle</param>
- <returns>Dummy SCardHandle object with card info</returns>
- </member>
- <member name="M:PCSCMicro.SCard.Reconnect(PCSCMicro.SCardHandle,PCSCMicro.SCardShareMode,PCSCMicro.SCardProtocol,PCSCMicro.SCardDisposition)">
- <summary>
- Resets card/reader if necessary, perfoms disposition
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_INVALID_VALUE – Invalid value of protocol, share mode, or disposition
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_NO_SMARTCARD – Cannot carry through disposition because Smart Card was removed
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has blocked access to reader
- </para>
- <para>
- SCARD_E_UNAVAILABLE_READER – Reader currently unavailable due to running test
- </para>
- </errors>
- <example>
- <code>
- // Establish Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- ... SCardError.SCARD_W_RESET_CARD returns after some function call...
- // Reconnect to Smart Card
- SCard.Reconnect(card, SCardShareMode.SHARED, SCardProtocol.T0, SCardDisposition.RESET_CARD);
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <remarks>
- This function reconnects the uFW to the connection made through
- Connect. This function carries through the action given as
- disposition. Thus function should be called if
- SCardError.SCARD_W_RESET_CARD is ever returned.
- </remarks>
- <param name="card">SCardHandle which was reset</param>
- <param name="share">Share mode to be used by Handle</param>
- <param name="protocol">Protocol to be used by Handle</param>
- <param name="disposition">Disposition to be used when
- reconnecting</param>
- <returns>True if successfully reconnected, false otherwise</returns>
- </member>
- <member name="M:PCSCMicro.SCard.Disconnect(PCSCMicro.SCardHandle,PCSCMicro.SCardDisposition)">
- <summary>
- Destroys handle created by Connect, performs disposition
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_INVALID_VALUE – Invalid value of disposition
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_NO_SMARTCARD – Cannot carry through disposition because Smart Card was removed
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- // Disconnect Smart Card
- SCard.Disconnect(card, SCardDisposition.UNPOWER_CARD);
- // Release Smart Card context
- SCard.ReleaseContext();
- </code>
- </example>
- <remarks>
- This function makes it so that the SCardHandle being destroyed
- can no longer be used in function calls, even if Reconnect is
- called. Furthermore, it performs whatever action is in the
- disposition parameter. For possible disposition values, see
- SCardDisposition.
- </remarks>
- <param name="card">SCardHandle to be disconnected</param>
- <param name="disposition">Disposition to be used when
- disconnecting</param>
- </member>
- <member name="M:PCSCMicro.SCard.Status(PCSCMicro.SCardHandle)">
- <summary>
- Returns current status, protocol for card, and Smart Card's ATR
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has blocked access to reader
- </para>
- <para>
- SCARD_E_UNKNOWN_CARD – Error occurred when checking card status
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- // Get current Smart Card status
- SCardStatusReturn status = SCard.Status(card);
- // Disconnect Smart Card
- SCard.Disconnect(card, SCardDisposition.UNPOWER_CARD);
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <remarks>
- This function returns the current status of the reader connected to by context.
- The current state, protocol, and ATR will all be returned from a Status() call.
- If Connect() has not yet been called, then the ATR returned will be null, and
- the protocol returned will be SCardProtocol.T0.
- </remarks>
- <param name="card">SCardHandle of which to check status</param>
- <returns>SCardStatusReturn object containing the status of the
- card, the protocol used by the context, and the ATR of the card.
- If the first is an error, then the protocol is T = 0 and the ATR
- is set to null</returns>
- </member>
- <member name="M:PCSCMicro.SCard.BeginTransaction(PCSCMicro.SCardHandle)">
- <summary>
- Block all other applications from accessing reader
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has share mode exlusive
- </para>
- <para>
- SCARD_W_RESET_CARD – Card was reset by another application
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- // Begin Smart Card transaction
- SCard.BeginTransaction(card);
- </code>
- </example>
- <remarks>This function establishes a temporary exclusive access mode
- for doing a series of commands or transaction. You might want to use
- this when you are selecting a few files and then writing a large
- file so you can make sure that another application will not change
- the current file. If another application has SCardShareMode.EXCLUSIVE
- on this reader or this application is in SCardShareMode.EXCLUSIVE
- there will be no action taken. If another application has a lock on
- this reader using BeginTransaction, then this function will wait
- until the reader is free.
- </remarks>
- <param name="card">SCardHandle to use to place block on reader</param>
- </member>
- <member name="M:PCSCMicro.SCard.EndTransaction(PCSCMicro.SCardHandle,PCSCMicro.SCardDisposition)">
- <summary>
- Remove block that was created by BeginTransaction
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_INVALID_VALUE – Provided disposition was invalid
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_NO_SMARTCARD – Cannot carry through disposition because Smart Card was removed
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has a lock on the reader
- </para>
- <para>
- SCARD_W_RESET_CARD – Card was reset by another application
- </para>
- <para>
- SCARD_E_ INVALID_TARGET – BeginTransaction was never called
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- // Begin Smart Card transaction
- SCard.BeginTransaction(card);
- // End Smart Card transaction
- SCard.EndTransaction(card, SCardDisposition.LEAVE_CARD);
- </code>
- </example>
- <remarks>This function ends a previously begun transaction. The
- calling application must be the owner of the previously begun
- transaction or an error will occur. Following the unlocking, the
- disposition action takes place on the card.
- </remarks>
- <param name="card">SCardHandle which placed block on reader</param>
- <param name="disposition">Disposition to be used when
- removing block</param>
- </member>
- <member name="M:PCSCMicro.SCard.Transmit(PCSCMicro.SCardHandle,PCSCMicro.SCardProtocol,System.String)">
- <summary>
- Sends APDU to card and returns cards response
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_INVALID_VALUE – Provided protocol was invalid
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_NO_SMARTCARD – Cannot change protocol because Smart Card was removed
- </para>
- <para>
- SCARD_E_NOT_TRANSACTED – Error occurred on APDU transmit
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has a lock on the reader
- </para>
- <para>
- SCARD_W_RESET_CARD – Card was reset by another application
- </para>
- <para>
- SCARD_E_UNAVAILABLE_READER – Reader currently unavailable due to running test
- </para>
- <para>
- SCARD_W_UNRESPONSIVE_CARD – No response received from Smart Card
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- // Create APDU command string
- string APDU = "00A40000020001";
- // Begin Smart Card transaction
- SCard.BeginTransaction(card);
- // Transmit APDU to Smart Card
- string response = SCard.Transmit(card, SCardProtocol.T0, APDU);
- // End Smart Card transaction
- SCard.EndTransaction(card, SCardDisposition.LEAVE_CARD);
- // Disconnect Smart Card
- SCard.Disconnect(card, SCardDisposition.RESET_CARD);
- // Release Smart Card context
- SCard.ReleaseContext(context);
- </code>
- </example>
- <remarks>This function sends an APDU to the smartcard contained in
- the reader connected to by SCardConnect. The card responds from
- the APDU and this response is returned as a string. This function
- sets the protocol before sending the APDU. </remarks>
- <param name="card">SCardHandle to use to transmit APDU</param>
- <param name="protocol">Protocol to use during transmission</param>
- <param name="APDU">APDU to send to card</param>
- <returns>Response APDU from the card</returns>
- </member>
- <member name="M:PCSCMicro.SCard.Control(PCSCMicro.SCardHandle,System.String,System.String)">
- <summary>
- Send command directly to IFD to be processed by reader
- </summary>
- <errors>
- <para>
- SCARD_S_SUCCESS – Successful
- </para>
- <para>
- SCARD_E_INVALID_HANDLE – Invalid card
- </para>
- <para>
- SCARD_E_NOT_READY – Waiting for GetStatusChange() to complete
- </para>
- <para>
- SCARD_E_SHARING_VIOLATION – Another application has a lock on the reader
- </para>
- <para>
- SCARD_E_NOT_TRANSACTED – Return value from reader is null
- </para>
- <para>
- SCARD_E_UNAVAILABLE_READER – Reader currently unavailable due to running test
- </para>
- </errors>
- <example>
- <code>
- // Establish new Smart Card context
- SCardContext context = SCard.EstablishContext();
- // Connect Smart Card
- SCardHandle card = SCard.Connect(context, SCardShareMode.SHARED, SCardProtocol.T0);
- // Create command strings
- string code = ... string representing valid command code...
- string message = ... string representing valid data...
- /…
Large files files are truncated, but you can click here to view the full file