| Total Complexity | 2 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class AttestationConstant |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Indicates full basic attestation as defined in [UAFProtocol]. |
||
| 11 | */ |
||
| 12 | public const TAG_ATTESTATION_BASIC_FULL = 0x3E07; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Indicates surrogate basic attestation as defined in [UAFProtocol]. |
||
| 16 | */ |
||
| 17 | public const TAG_ATTESTATION_BASIC_SURROGATE = 0x3E08; |
||
| 18 | |||
| 19 | public const TAG_ATTESTATION_ATT_CA = 0x3E0A; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Indicates use of elliptic curve based direct anonymous attestation as defined in [FIDOEcdaaAlgorithm]. |
||
| 23 | */ |
||
| 24 | public const TAG_ATTESTATION_ECDAA = 0x3E09; |
||
| 25 | |||
| 26 | private const MAP = [ |
||
| 27 | AttestationType::BASIC => self::TAG_ATTESTATION_BASIC_FULL, |
||
| 28 | AttestationType::SELF => self::TAG_ATTESTATION_BASIC_SURROGATE, |
||
| 29 | AttestationType::ATT_CA => self::TAG_ATTESTATION_ATT_CA, |
||
| 30 | AttestationType::ECDAA => self::TAG_ATTESTATION_ECDAA, |
||
| 31 | ]; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @codeCoverageIgnore |
||
| 35 | */ |
||
| 36 | private function __construct() |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Converts AttestationType style constant to numerical constant. |
||
| 42 | * Returns null if there is no equivalent. |
||
| 43 | */ |
||
| 44 | 3 | public static function convertType(string $type): ?int |
|
| 49 |