Type Summary
Action |
ATR |
Primitive Operations: |
Size ,
Size ,
Status ,
To_Atr
|
Attribute |
Byte_Set |
Card (limited type) |
Primitive Operations: |
Begin_Transaction ,
Connect ,
Control ,
Disconnect ,
End_Transaction ,
Get_Active_Proto ,
Get_Attribute ,
Get_PCI ,
Init_Attribute_Set ,
Reconnect ,
SPE_Exec ,
SPE_Init ,
Status ,
Transmit
|
Card_State |
Card_States_Set |
Primitive Operations: |
Add ,
Is_In ,
Status
|
Context (limited type) |
Primitive Operations: |
Cancel ,
Connect ,
Establish_Context ,
Is_Valid ,
List_Readers ,
Release_Context ,
Status_Change ,
Wait_For_Readers
|
Mode |
PCI |
Proto |
Reader_Condition |
Primitive Operations: |
Add ,
Get
|
Reader_Condition_Handle |
Reader_Condition_Set |
Primitive Operations: |
Add ,
Find ,
First_Index ,
Get ,
Last_Index ,
Length ,
Status_Change
|
Reader_ID |
Primitive Operations: |
Connect ,
Find ,
First_Item ,
Get ,
Last_Item ,
To_Reader_ID
|
Reader_ID_Set |
Primitive Operations: |
Empty ,
First_Index ,
First_Item ,
Get ,
Last_Index ,
Last_Item ,
List_Readers
|
Reader_State |
Reader_States_Set |
Primitive Operations: |
Add ,
First_Index ,
First_Item ,
Get ,
Is_In ,
Last_Index ,
Last_Item ,
Remove
|
Scope |
|
Constants and Named Numbers
|
Other Items:
|
type Context is limited private;
|
This is the PC/SC-Context. This object is initialized by
Establish_Context below and is used with all services.
|
|
type Card is limited private;
|
SCard-Handler, returned by Connect. Used to access a specific smartcard.
|
|
type Byte_Set is array (Natural range <>) of aliased Thin.Byte;
|
Byte_Sets are used to send and receive data to/from SCard-Readers.
|
|
type ATR is private;
|
Card ATR type
|
|
type Reader_ID is private;
|
Reader friendly name
|
|
|
|
|
|
|
|
|
type Reader_State is
(S_Reader_Unaware,
S_Reader_Ignore,
S_Reader_Changed,
S_Reader_Unknown,
S_Reader_Unavailable,
S_Reader_Empty,
S_Reader_Present,
S_Reader_Atrmatch,
S_Reader_Exclusive,
S_Reader_Inuse,
S_Reader_Mute,
S_Reader_Unpowered
);
|
Reader / Card states
|
|
|
|
|
|
|
|
type Attribute is
(Attr_Vendor_Name,
Attr_Vendor_IFD_Type,
Attr_Vendor_IFD_Version,
Attr_Vendor_IFD_Serial,
Attr_Channel_ID,
Attr_Default_CLK,
Attr_Max_CLK,
Attr_Default_Data_Rate,
Attr_Max_Data_Rate,
Attr_Max_IFSD,
Attr_Power_Mgmt_Support,
Attr_Characteristics,
Attr_Current_Protocol_Type,
Attr_Current_CLK,
Attr_Current_F,
Attr_Current_D,
Attr_Current_N,
Attr_Current_W,
Attr_Current_IFSC,
Attr_Current_IFSD,
Attr_Current_BWT,
Attr_Current_CWT,
Attr_Current_EBC_Encoding,
Attr_Extended_BWT,
Attr_ICC_Presence,
Attr_ICC_Interface_Status,
Attr_Current_IO_State,
Attr_ATR_String,
Attr_ICC_Type_Per_ATR,
Attr_ESC_Preset,
Attr_ESC_Cancel,
Attr_ESC_Authrequest,
Attr_Maxinput,
Attr_Device_Unit,
Attr_Device_In_Use,
Attr_Device_Friendly_Name_A,
Attr_Device_System_Name_A,
Attr_Device_Friendly_Name_W,
Attr_Device_System_Name_W,
Attr_Supress_T1_IFS_Request);
|
Possible attributes for Get_Attribute procedure
|
|
|
|
|
procedure Begin_Transaction (Card : SCard.Card);
|
This procedure establishes a temporary exclusive access mode for doing
a series of commands or transactions with a SCard.
|
|
procedure Cancel (Context : SCard.Context);
|
This procedure cancels all pending blocking requests on the
Status_Change() procedure for a given SCard 'Context'.
|
|
|
procedure Control
(Card : SCard.Card;
Code : Natural;
Send_Buffer : Byte_Set := Null_Byte_Set;
Recv_Buffer : in out Byte_Set;
Recv_Len : in out Natural);
|
This procedure sends a control command to the reader connected to by
Connect(). It returns the the control response in Recv_Buffer.
|
|
procedure Disconnect
(Card : SCard.Card;
Action : SCard.Action);
|
This procedure terminates a connection to a card.
|
|
function Empty (Set : Reader_ID_Set) return Boolean;
|
This function returns True if the reader ID set contains no readers.
|
|
|
procedure Establish_Context
(Context : in out SCard.Context;
Scope : SCard.Scope);
|
Establish PC/SC-context. Possible Scope values are defined in the
SCard_Scope type.
|
|
function Find
(Set : Reader_Condition_Set;
Reader_ID : SCard.Reader_ID)
return Boolean;
|
Search a given Reader_ID in Reader_Condition_Set. If found, True is
returned, False if not found.
|
|
|
|
|
|
|
|
|
|
|
procedure Get_Attribute
(Card : SCard.Card;
Attr : Attribute;
Recv_Buffer : in out Byte_Set);
|
This procedure gets an attribute from the IFD handler. Call
Init_Attribute_Set prior to this function to allocate the correct byte
set for the call.
|
|
function Get_PCI (Card : SCard.Card) return Thin.SCARD_IO_REQUEST;
|
Return PCI to use for a given card. If no valid PCI for a proto is
found, a No_PCI_for_Proto exception will be thrown.
|
|
function Get_Return_Code return String;
|
Return string representation of last stored return code.
|
|
function Init_Attribute_Set
(Card : SCard.Card;
Attr : Attribute)
return Byte_Set;
|
This function returns an Null_Byte initialized byte set to provide
storage for an attribute 'Attr'. The byte set can then be used as
parameter to the Get_Attribute function to actually retrieve the
attribute data.
|
|
|
function Is_In
(States : Card_States_Set;
State : Card_State)
return Boolean;
|
Function returns True if given card state is found in the card states
set.
|
|
function Is_Valid (Context : SCard.Context) return Boolean;
|
Verify that given SCard context is valid.
|
|
|
|
|
|
|
|
|
procedure Reconnect
(Card : in out SCard.Card;
Mode : SCard.Mode;
Action : SCard.Action);
|
This procedure re-establishes a connection. The Init argument defines the
desired SCard action to perform on the card/reader.
|
|
|
|
procedure SPE_Exec (Card : in out SCard.Card; Result : in out Byte_Set);
|
Request the reader connected to by 'Card' to perform a secure PIN entry
operation. If not already done by the client code, this procedure will
use the SPE_Init() procedure to check if the reader supports SPE and to
initialize the verify ctrl code. If the SPE operation is not supported
or does not work as expected, an SCard_Not_Supported exception is
raised. If the SPE operation is successful, the bytes returned from the
reader will be stored in 'Result' byte set.
|
|
procedure SPE_Init (Card : in out SCard.Card; Result : in out Boolean);
|
Procedure checks if a reader connected by 'Card' handle supports SPE
(secure PIN entry) operation. If it does, 'Result' will be True,
otherwise 'Result' will be False.
|
|
function Size (Atr : SCard.ATR := Null_ATR) return Natural;
|
Return current size of an ATR as Natural.
|
|
function Size (Atr : SCard.ATR := Null_ATR) return String;
|
Return current size of an ATR as string.
|
|
procedure Status
(Card : SCard.Card;
State : out SCard.Card_States_Set;
Proto : out SCard.Proto;
Atr : out SCard.ATR);
|
This procedure checks the current status of the reader connected to by
'Card'. Current state, protocol and ATR value of inserted card are
returned as out parameters.
|
|
procedure Status_Change
(Context : SCard.Context;
Timeout : Natural := 0;
Conditions : in out Reader_Condition_Set);
|
This procedure takes a reader condition set containing reader names
with their assumed state. It then blocks maximum 'Timeout' milliseconds
time for a change in state to occur. If no timeout is given, 0 will be
used, which will block forever. When a status change occurs, the
Conditions object is updated to reflect the change(s). If this procedure
is called with an empty Conditions object, Wait_For_Readers() is used
to wait for a reader to appear, then the procedure returns.
|
|
procedure Wait_For_Readers (Context : SCard.Context);
|
This procedure calls SCardGetStatusChange for reader detection. If there
is no reader available, the call will block until a reader is connected.
If there are readers present when this function is called, it will
return immediately.
|
|
|
function To_Atr (Bytes : Byte_Set) return ATR;
|
Create new ATR object from given byte set. If 'Bytes' is too big to be
converted into an ATR type, a 'Bytes_Too_Big' exception will be raised.
|
|
function To_Reader_ID (Name : String) return Reader_ID;
|
Returns a new reader ID initialized with 'Name' string.
|
|
|
private
|