Debian Codegraph @

lib/3rdParty/composer/web-auth/webauthn-lib/src/PublicKeyCredentialDescriptor.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Webauthn;
6
7 class PublicKeyCredentialDescriptor
8 {
9 final public const CREDENTIAL_TYPE_PUBLIC_KEY = 'public-key';
10
11 final public const AUTHENTICATOR_TRANSPORT_USB = 'usb';
12
13 final public const AUTHENTICATOR_TRANSPORT_NFC = 'nfc';
14
15 final public const AUTHENTICATOR_TRANSPORT_BLE = 'ble';
16
17 /**
18 * @deprecated Please use AUTHENTICATOR_TRANSPORT_BLE instead. Will be removed in 6.0.0
19 */
20 final public const AUTHENTICATOR_TRANSPORT_CABLE = 'cable';
21
22 final public const AUTHENTICATOR_TRANSPORT_SMART_CARD = 'smart-card';
23
24 final public const AUTHENTICATOR_TRANSPORT_HYBRID = 'hybrid';
25
26 final public const AUTHENTICATOR_TRANSPORT_INTERNAL = 'internal';
27
28 final public const AUTHENTICATOR_TRANSPORTS = [
29 self::AUTHENTICATOR_TRANSPORT_USB,
30 self::AUTHENTICATOR_TRANSPORT_NFC,
31 self::AUTHENTICATOR_TRANSPORT_BLE,
32 self::AUTHENTICATOR_TRANSPORT_CABLE,
33 self::AUTHENTICATOR_TRANSPORT_SMART_CARD,
34 self::AUTHENTICATOR_TRANSPORT_HYBRID,
35 self::AUTHENTICATOR_TRANSPORT_INTERNAL,
36 ];
37
38 /**
39 * @param string[] $transports
40 */
41 public function __construct(
42 public readonly string $type,
43 public readonly string $id,
44 public readonly array $transports = []
45 ) {
46 }
47
48 /**
49 * @param string[] $transports
50 */
51 public static function create(string $type, string $id, array $transports = []): self
52 {
53 return new self($type, $id, $transports);
54 }
55 }