File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
- /*
6
- * The MIT License (MIT)
7
- *
8
- * Copyright (c) 2014-2020 Spomky-Labs
9
- *
10
- * This software may be modified and distributed under the terms
11
- * of the MIT license. See the LICENSE file for details.
12
- */
13
-
14
5
namespace Jose \Component \Encryption \Algorithm \KeyEncryption ;
15
6
16
7
use function in_array ;
21
12
22
13
final class Dir implements DirectEncryption
23
14
{
24
- /**
25
- * @throws InvalidArgumentException if the key is invalid
26
- */
27
15
public function getCEK (JWK $ key ): string
28
16
{
29
- if (!in_array ($ key ->get ('kty ' ), $ this ->allowedKeyTypes (), true )) {
17
+ if (! in_array ($ key ->get ('kty ' ), $ this ->allowedKeyTypes (), true )) {
30
18
throw new InvalidArgumentException ('Wrong key type. ' );
31
19
}
32
- if (!$ key ->has ('k ' )) {
20
+ if (! $ key ->has ('k ' )) {
33
21
throw new InvalidArgumentException ('The key parameter "k" is missing. ' );
34
22
}
35
23
$ k = $ key ->get ('k ' );
36
- if (!is_string ($ k )) {
24
+ if (! is_string ($ k )) {
37
25
throw new InvalidArgumentException ('The key parameter "k" is invalid. ' );
38
26
}
39
27
You can’t perform that action at this time.
0 commit comments