Top |
void | card-inserted | Run First |
void | card-removed | Run First |
void | reader-added | Run First |
void | 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).
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
GList *
spice_smartcard_manager_get_readers (SpiceSmartcardManager *manager
);
Gets the list of smartcard readers that are currently available, they can be either software (emulated) readers, or hardware ones.
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.
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.
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.
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.
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.
struct SpiceSmartcardManager;
The SpiceSmartcardManager struct is opaque and should not be accessed directly.
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 ); };
Class structure for SpiceSmartcardManager.
GObjectClass |
Parent class. |
|
Signal class handler for the “reader_added” signal. |
||
Signal class handler for the “reader_removed” signal. |
||
Signal class handler for the “card_inserted” signal. |
||
Signal class handler for the “card_removed” signal. |
typedef struct _SpiceSmartcardReader SpiceSmartcardReader;
The SpiceSmartcardReader struct is opaque and cannot be accessed directly.
“card-inserted”
signalvoid user_function (SpiceSmartcardManager *manager, VReader *vreader, gpointer user_data)
The “card-inserted” signal is emitted whenever a smartcard is inserted in a reader
manager |
the SpiceSmartcardManager that emitted the signal |
|
vreader |
VReader boxed object corresponding to the reader a new card was inserted in |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“card-removed”
signalvoid user_function (SpiceSmartcardManager *manager, VReader *vreader, gpointer user_data)
The “card-removed” signal is emitted whenever a smartcard was removed from a reader.
manager |
the SpiceSmartcardManager that emitted the signal |
|
vreader |
VReader boxed object corresponding to the reader a card was removed from |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“reader-added”
signalvoid user_function (SpiceSmartcardManager *manager, VReader *vreader, gpointer user_data)
The “reader-added” signal is emitted whenever a new smartcard reader (software or hardware) has been plugged in.
manager |
the SpiceSmartcardManager that emitted the signal |
|
vreader |
VReader boxed object corresponding to the added reader |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“reader-removed”
signalvoid user_function (SpiceSmartcardManager *manager, VReader *vreader, gpointer user_data)
The “reader-removed” signal is emitted whenever a smartcard reader (software or hardware) has been removed.
manager |
the SpiceSmartcardManager that emitted the signal |
|
vreader |
VReader boxed object corresponding to the removed reader |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First