Skip to content

Commit

Permalink
PHP 8 Support: check if key is already a OpenSSLAsymmetricKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Koval committed Jun 18, 2021
1 parent 188f6e0 commit 116e645
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Namshi/JOSE/Signer/OpenSSL/PublicKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public function verify($key, $signature, $input)
/**
* Converts a string representation of a key into an OpenSSL resource.
*
* @param string|resource $key
* @param string|resource|\OpenSSLAsymmetricKey $key
* @param string $password
*
* @return resource OpenSSL key resource
* @return resource|\OpenSSLAsymmetricKey OpenSSL key resource
*/
protected function getKeyResource($key, $password = null)
{
if (is_resource($key)) {
if (is_resource($key) || $key instanceof \OpenSSLAsymmetricKey) {
return $key;
}

Expand Down

0 comments on commit 116e645

Please sign in to comment.