protected function getKeyResource($key, $password = null)
    {
        if (is_resource($key)) {
            return $key;
        }

        $resource = openssl_pkey_get_public($key) ?: openssl_pkey_get_private($key, $password);
        if ($resource === false) {
            throw new RuntimeException('Could not read key resource: ' . openssl_error_string());
        }
        return $resource;
    }
protected function getKeyResource($key, $password = null)
    {
        if (is_resource($key)) {
            return $key;
        }

        $resource = openssl_pkey_get_public($key) ?: openssl_pkey_get_private($key, $password);
        if ($resource === false) {
            throw new RuntimeException('Could not read key resource: ' . openssl_error_string());
        }
        return $resource;
    }
protected function getKeyResource ( $ key , $ password = null ) { if ( is_resource ( $ key ) ) { return $ key ; } $ resource = openssl_pkey_get_public ( $ key ) ? : openssl_pkey_get_private ( $ key , $ password ) ; if ( $ resource === false ) { throw new RuntimeException ( 'Could not read key resource: ' . openssl_error_string ( ) ) ; } return $ resource ; }
Converts a string representation of a key into an OpenSSL resource.

@param string|resource $key
@param string          $password

@return resource OpenSSL key resource
Converts a string representation of a key into an OpenSSL resource .