Tokens¶
The Token
class is described below:
-
class
SCWS.
Token
()¶ SCWS.Token Represents connection to a smart card (or more generally, any cryptographic device). Token objects are obtained by calling the
Reader.connect()
method.
-
Token.
reader
¶ The
SCWS.Reader()
object from which this token is issued.
-
Token.
manufacturer
¶ String containing the token manufacturer name.
-
Token.
model
¶ String containing the token model name.
-
Token.
serialNumber
¶ String containing the token serial number.
-
Token.
label
¶ String containing the token label.
-
Token.
initialized
¶ Boolean indicating whether this token has been initialized.
-
Token.
protectedAuthPath
¶ Boolean indicating whether this token allows user authentication through a hardware protected path (like a PIN pad reader, or using biometric recognition).
-
Token.
pins
¶ Array of
SCWS.Pin()
objects describing all the PINs available with this card.
-
Token.
disconnect
()¶ Disconnects from the token. Must be called when the application terminates (e.g. from the
onbeforeunload
/onunload
events), or before.- Returns
A
Promise
resolved when the operation has been performed (the resolution value is undefined).
-
Token.
updateInfos
(slot)¶ Forces the update of the internally cached state of the token (e.g. PIN status).
For all operations that are likely to invalidate the cached state (like PIN verification operations), this is done automatically. You normally don’t need to call this method explicitly.
- Returns
A
Promise
resolved when the update has been made (the resolution value is undefined).
-
Token.
getObjects
()¶ Retrieves all objects found in the token (certificates and keys). Note that private objects may not be returned if the associated PIN has not been verified previously.
Each call to this method generates a list of newly created objects, even if the objects have been previously obtained. To check whether a new object corresponds to a previously obtained one, the
Object.handle
property can be used. This value is guaranteed to be the same for two items referring to the same physical object in the token.- Returns
A
Promise
resolving to the array ofSCWS.Object()
items.