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