Jose\Behaviour\HasKeyChecker::checkKeyAlgorithm PHP Method

checkKeyAlgorithm() protected method

protected checkKeyAlgorithm ( Jose\Object\JWKInterface $key, string $algorithm )
$key Jose\Object\JWKInterface
$algorithm string
    protected function checkKeyAlgorithm(JWKInterface $key, $algorithm)
    {
        if (!$key->has('alg')) {
            return;
        }
        Assertion::eq($key->get('alg'), $algorithm, sprintf('Key is only allowed for algorithm "%s".', $key->get('alg')));
    }