![]() |
![]() |
![]() |
Spice-GTK Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <smartcard-manager.h> struct SpiceSmartcardManager; struct SpiceSmartcardManagerClass; SpiceSmartcardReader; SpiceSmartcardManager * spice_smartcard_manager_get (void
); GList * spice_smartcard_manager_get_readers (SpiceSmartcardManager *manager
); gboolean spice_smartcard_manager_insert_card (SpiceSmartcardManager *manager
); gboolean spice_smartcard_manager_remove_card (SpiceSmartcardManager *manager
); gboolean spice_smartcard_reader_is_software (SpiceSmartcardReader *reader
); gboolean spice_smartcard_reader_insert_card (SpiceSmartcardReader *reader
); gboolean spice_smartcard_reader_remove_card (SpiceSmartcardReader *reader
);
"card-inserted" :Run First
"card-removed" :Run First
"reader-added" :Run First
"reader-removed" :Run First
SpiceSmartcardManager monitors smartcard reader plugging/unplugging, and smartcard insertions/removals. It also provides methods to handle software smartcards (to emulate a smartcard reader/smartcard on the guest using 3 certificates available to the client).
struct SpiceSmartcardManagerClass { GObjectClass parent_class; /* signals */ void (*reader_added)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader); void (*reader_removed)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader); void (*card_inserted)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader); void (*card_removed)(SpiceSmartcardManager *manager, SpiceSmartcardReader *reader ); };
SpiceSmartcardManager * spice_smartcard_manager_get (void
);
SpiceSmartcardManager is a singleton, use this function to get a pointer to it. A new SpiceSmartcardManager instance will be created the first time this function is called
Returns : |
a weak reference to the SpiceSmartcardManager. [transfer none] |
GList * spice_smartcard_manager_get_readers (SpiceSmartcardManager *manager
);
manager: a SpiceSmartcardManager
Gets the list of smartcard readers that are currently available, they can be either software (emulated) readers, or hardware ones.
Returns : |
a newly
allocated list of SpiceSmartcardReader instances, or NULL if none were
found. When no longer needed, the list must be freed after unreferencing
its elements with g_boxed_free() . [element-type SpiceSmartcardReader][transfer full]
|
Since 0.20
gboolean spice_smartcard_manager_insert_card (SpiceSmartcardManager *manager
);
Simulates the insertion of a smartcard in the guest. Valid certificates must have been set in "smartcard-certificates" for software smartcard support to work. At the moment, only one software smartcard reader is supported, that's why there is no parameter to indicate which reader to insert the card in.
|
a SpiceSmartcardManager |
Returns : |
TRUE if smartcard insertion was successfully simulated, FALSE if this failed, or if software smartcard support isn't enabled. |
Since 0.20
gboolean spice_smartcard_manager_remove_card (SpiceSmartcardManager *manager
);
Simulates the removal of a smartcard in the guest. At the moment, only one software smartcard reader is supported, that's why there is no parameter to indicate which reader to insert the card in.
|
a SpiceSmartcardManager |
Returns : |
TRUE if smartcard removal was successfully simulated, FALSE if this failed, or if software smartcard support isn't enabled. |
Since 0.20
gboolean spice_smartcard_reader_is_software (SpiceSmartcardReader *reader
);
Tests if reader
is a software (emulated) smartcard reader.
|
a SpiceSmartcardReader |
Returns : |
TRUE if reader is a software (emulated) smartcard reader,
FALSE otherwise |
gboolean spice_smartcard_reader_insert_card (SpiceSmartcardReader *reader
);
Simulates insertion of a smartcard in the software smartcard reader
reader
. If reader
is not a software smartcard reader, FALSE will be
returned.
|
a SpiceSmartcardReader |
Returns : |
TRUE if insertion of a card was successfully simulated, FALSE otherwise |
gboolean spice_smartcard_reader_remove_card (SpiceSmartcardReader *reader
);
Simulates removal of a smartcard from the software smartcard reader
reader
. If reader
is not a software smartcard reader, FALSE will be
returned.
|
a SpiceSmartcardReader |
Returns : |
TRUE if removal of a card was successfully simulated, FALSE otherwise |
"card-inserted"
signalvoid user_function (SpiceSmartcardManager *manager,
VReader *vreader,
gpointer user_data) : Run First
The "card-inserted" signal is emitted whenever a smartcard is inserted in a reader
|
the SpiceSmartcardManager that emitted the signal |
|
VReader boxed object corresponding to the reader a new card was inserted in |
|
user data set when the signal handler was connected. |
"card-removed"
signalvoid user_function (SpiceSmartcardManager *manager,
VReader *vreader,
gpointer user_data) : Run First
The "card-removed" signal is emitted whenever a smartcard was removed from a reader.
|
the SpiceSmartcardManager that emitted the signal |
|
VReader boxed object corresponding to the reader a card was removed from |
|
user data set when the signal handler was connected. |
"reader-added"
signalvoid user_function (SpiceSmartcardManager *manager,
VReader *vreader,
gpointer user_data) : Run First
The "reader-added" signal is emitted whenever a new smartcard reader (software or hardware) has been plugged in.
|
the SpiceSmartcardManager that emitted the signal |
|
VReader boxed object corresponding to the added reader |
|
user data set when the signal handler was connected. |
"reader-removed"
signalvoid user_function (SpiceSmartcardManager *manager,
VReader *vreader,
gpointer user_data) : Run First
The "reader-removed" signal is emitted whenever a smartcard reader (software or hardware) has been removed.
|
the SpiceSmartcardManager that emitted the signal |
|
VReader boxed object corresponding to the removed reader |
|
user data set when the signal handler was connected. |