CoreFiles by mySites.guru
UnsafeRsa.php31 lines, 942 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
87f07d34f3b1fd009e3df553585bf4de
sha1
3068b1eebe0daecbc1d3bf0d9d87357a4db86136
sha256
60e508de4754f96e0679ccfe18458c4c9a5da4449e1286a1984650886ccd64cd
<?php
declare(strict_types=1);

namespace Lcobucci\JWT\Signer;

use const OPENSSL_KEYTYPE_RSA;

/** @deprecated Deprecated since v4.2 */
abstract class UnsafeRsa extends OpenSSL
{
    final public function sign(string $payload, Key $key): string
    {
        return $this->createSignature($key->contents(), $key->passphrase(), $payload);
    }

    final public function verify(string $expected, string $payload, Key $key): bool
    {
        return $this->verifySignature($expected, $payload, $key->contents());
    }

    // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
    final protected function guardAgainstIncompatibleKey(int $type, int $lengthInBits): void
    {
        if ($type !== OPENSSL_KEYTYPE_RSA) {
            throw InvalidKeyProvided::incompatibleKeyType(
                self::KEY_TYPE_MAP[OPENSSL_KEYTYPE_RSA],
                self::KEY_TYPE_MAP[$type],
            );
        }
    }
}

The same content is in 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.