public function with(JWK $jwk): self
    {
        $clone = clone $this;

        if ($jwk->has('kid')) {
            $clone->keys[$jwk->get('kid')] = $jwk;
        } else {
            $clone->keys[] = $jwk;
        }

        return $clone;
    }
public function with(JWK $jwk): self
    {
        $clone = clone $this;

        if ($jwk->has('kid')) {
            $clone->keys[$jwk->get('kid')] = $jwk;
        } else {
            $clone->keys[] = $jwk;
        }

        return $clone;
    }
public function with ( JWK $ jwk ) : self { $ clone = clone $ this ; if ( $ jwk -> has ( 'kid' ) ) { $ clone -> keys [ $ jwk -> get ( 'kid' ) ] = $ jwk ; } else { $ clone -> keys [ ] = $ jwk ; } return $ clone ; }
Add key to store in the key set.
This method is immutable and will return a new object.

@return JWKSet
Add key to store in the key set . This method is immutable and will return a new object .