1<?php
2
3/**
4 * This file is part of the FreeDSx SASL package.
5 *
6 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace FreeDSx\Sasl;
13
14/**
15 * Describes the "strength" of a particular mechanism.
16 *
17 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
18 */
19class SecurityStrength
20{
21    /**
22     * @var bool
23     */
24    protected $supportsIntegrity;
25
26    /**
27     * @var bool
28     */
29    protected $supportsPrivacy;
30
31    /**
32     * @var bool
33     */
34    protected $supportsAuth;
35
36    /**
37     * @var bool
38     */
39    protected $isPlainTextAuth;
40
41    /**
42     * @var int
43     */
44    protected $maxKeySize;
45
46    public function __construct(
47        bool $supportsIntegrity,
48        bool $supportsPrivacy,
49        bool $supportsAuth,
50        bool $isPlainTextAuth,
51        int $maxKeySize
52    ) {
53        $this->supportsIntegrity = $supportsIntegrity;
54        $this->supportsPrivacy = $supportsPrivacy;
55        $this->supportsAuth = $supportsAuth;
56        $this->isPlainTextAuth = $isPlainTextAuth;
57        $this->maxKeySize = $maxKeySize;
58    }
59
60    public function supportsIntegrity(): bool
61    {
62        return $this->supportsIntegrity;
63    }
64
65    public function supportsPrivacy(): bool
66    {
67        return $this->supportsPrivacy;
68    }
69
70    public function supportsAuth(): bool
71    {
72        return $this->supportsAuth;
73    }
74
75    public function isPlainTextAuth(): bool
76    {
77        return $this->isPlainTextAuth;
78    }
79
80    public function maxKeySize(): int
81    {
82        return $this->maxKeySize;
83    }
84}
85