public function thumbprint(string $hash_algorithm): string
    {
        if (!\in_array($hash_algorithm, \hash_algos(), true)) {
            throw new \InvalidArgumentException(\sprintf('The hash algorithm "%s" is not supported.', $hash_algorithm));
        }

        $values = \array_intersect_key($this->values, \array_flip(['kty', 'n', 'e', 'crv', 'x', 'y', 'k']));
        \ksort($values);
        $input = \json_encode($values, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

        return Base64Url::encode(\hash($hash_algorithm, $input, true));
    }
public function thumbprint(string $hash_algorithm): string
    {
        if (!\in_array($hash_algorithm, \hash_algos(), true)) {
            throw new \InvalidArgumentException(\sprintf('The hash algorithm "%s" is not supported.', $hash_algorithm));
        }

        $values = \array_intersect_key($this->values, \array_flip(['kty', 'n', 'e', 'crv', 'x', 'y', 'k']));
        \ksort($values);
        $input = \json_encode($values, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);

        return Base64Url::encode(\hash($hash_algorithm, $input, true));
    }
public function thumbprint ( string $ hash_algorithm ) : string { if ( ! \ in_array ( $ hash_algorithm , \ hash_algos ( ) , true ) ) { throw new \ InvalidArgumentException ( \ sprintf ( 'The hash algorithm "%s" is not supported.' , $ hash_algorithm ) ) ; } $ values = \ array_intersect_key ( $ this -> values , \ array_flip ( [ 'kty' , 'n' , 'e' , 'crv' , 'x' , 'y' , 'k' ] ) ) ; \ ksort ( $ values ) ; $ input = \ json_encode ( $ values , JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ) ; return Base64Url :: encode ( \ hash ( $ hash_algorithm , $ input , true ) ) ; }
Returns the thumbprint of the key.

@see https://tools.ietf.org/html/rfc7638

@throws \InvalidArgumentException
Returns the thumbprint of the key .