-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignatureScheme.php
More file actions
48 lines (40 loc) · 1.22 KB
/
SignatureScheme.php
File metadata and controls
48 lines (40 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types=1);
/*
* This file is a part of the DiscordPHP-RFC9420 project.
*
* Copyright (c) 2026-present Valithor Obsidion <valithor@discordphp.org>
*
* This file is subject to the MIT license that is bundled
* with this source code in the LICENSE.md file.
*/
namespace MLS\Enums;
/**
* Signature scheme identifiers referenced by MLS cipher suites (Table 7).
*/
final class SignatureScheme
{
public const ED25519 = 'ed25519';
public const ECDSA_SECP256R1_SHA256 = 'ecdsa_secp256r1_sha256';
public const ED448 = 'ed448';
public const ECDSA_SECP521R1_SHA512 = 'ecdsa_secp521r1_sha512';
public const ECDSA_SECP384R1_SHA384 = 'ecdsa_secp384r1_sha384';
protected const RECOMMENDED = [
self::ED25519 => true,
self::ECDSA_SECP256R1_SHA256 => true,
self::ED448 => true,
self::ECDSA_SECP521R1_SHA512 => true,
self::ECDSA_SECP384R1_SHA384 => true,
];
public function __construct()
{
}
public static function list(): array
{
return array_keys(self::RECOMMENDED);
}
public static function isRecommended(string $scheme): bool
{
return isset(self::RECOMMENDED[$scheme]) && self::RECOMMENDED[$scheme] === true;
}
}