Jose\Behaviour\EncrypterTrait::areKeyManagementModesCompatible PHP Метод

areKeyManagementModesCompatible() приватный Метод

private areKeyManagementModesCompatible ( string $current, string $new ) : boolean
$current string
$new string
Результат boolean
    private function areKeyManagementModesCompatible($current, $new)
    {
        $agree = Algorithm\KeyEncryptionAlgorithmInterface::MODE_AGREEMENT;
        $dir = Algorithm\KeyEncryptionAlgorithmInterface::MODE_DIRECT;
        $enc = Algorithm\KeyEncryptionAlgorithmInterface::MODE_ENCRYPT;
        $wrap = Algorithm\KeyEncryptionAlgorithmInterface::MODE_WRAP;
        $supported_key_management_mode_combinations = [$enc . $enc => true, $enc . $wrap => true, $wrap . $enc => true, $wrap . $wrap => true, $agree . $agree => false, $agree . $dir => false, $agree . $enc => false, $agree . $wrap => false, $dir . $agree => false, $dir . $dir => false, $dir . $enc => false, $dir . $wrap => false, $enc . $agree => false, $enc . $dir => false, $wrap . $agree => false, $wrap . $dir => false];
        if (array_key_exists($current . $new, $supported_key_management_mode_combinations)) {
            return $supported_key_management_mode_combinations[$current . $new];
        }
        return false;
    }