Token constructor

Token({
  1. required String id,
  2. required JSObject subtleCrypto,
  3. required JSObject softwareBackedSubtleCrypto,
})

Implementation

Token({
  /// Uniquely identifies this `Token`.
  /// Static IDs are `"user"` and `"system"`,
  /// referring to the platform's user-specific and the system-wide hardware
  /// token, respectively. Any other tokens (with other identifiers) might be
  /// returned by [enterprise.platformKeys.getTokens].
  required String id,

  /// Implements the WebCrypto's
  /// [SubtleCrypto](http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface)
  /// interface. The cryptographic operations, including key generation, are
  /// hardware-backed.
  /// Only non-extractable RSASSA-PKCS1-V1_5 keys with
  /// `modulusLength` up to 2048 and ECDSA with
  /// `namedCurve` P-256 can be generated. Each key can be
  /// used for signing data at most once.
  /// Keys generated on a specific `Token` cannot be used with
  /// any other Tokens, nor can they be used with
  /// `window.crypto.subtle`. Equally, `Key` objects
  /// created with `window.crypto.subtle` cannot be used with this
  /// interface.
  required JSObject subtleCrypto,

  /// Implements the WebCrypto's
  /// [SubtleCrypto](http://www.w3.org/TR/WebCryptoAPI/#subtlecrypto-interface)
  /// interface. The cryptographic operations, including key generation, are
  /// software-backed. Protection of the keys, and thus implementation of the
  /// non-extractable property, is done in software, so the keys are less
  /// protected than hardware-backed keys.
  /// Only non-extractable RSASSA-PKCS1-V1_5 keys with
  /// `modulusLength` up to 2048 can be generated. Each key can be
  /// used for signing data at most once.
  /// Keys generated on a specific `Token` cannot be used with
  /// any other Tokens, nor can they be used with
  /// `window.crypto.subtle`. Equally, `Key` objects
  /// created with `window.crypto.subtle` cannot be used with this
  /// interface.
  required JSObject softwareBackedSubtleCrypto,
}) : _wrapped = $js.Token(
        id: id,
        subtleCrypto: subtleCrypto,
        softwareBackedSubtleCrypto: softwareBackedSubtleCrypto,
      );