public function serialize(string $name, JWE $jws, ?int $recipientIndex = null): string
    {
        if (!\array_key_exists($name, $this->serializers)) {
            throw new \InvalidArgumentException(\sprintf('Unsupported serializer "%s".', $name));
        }

        return ($this->serializers[$name])->serialize($jws, $recipientIndex);
    }
public function serialize(string $name, JWE $jws, ?int $recipientIndex = null): string
    {
        if (!\array_key_exists($name, $this->serializers)) {
            throw new \InvalidArgumentException(\sprintf('Unsupported serializer "%s".', $name));
        }

        return ($this->serializers[$name])->serialize($jws, $recipientIndex);
    }
public function serialize ( string $ name , JWE $ jws , ? int $ recipientIndex = null ) : string { if ( ! \ array_key_exists ( $ name , $ this -> serializers ) ) { throw new \ InvalidArgumentException ( \ sprintf ( 'Unsupported serializer "%s".' , $ name ) ) ; } return ( $ this -> serializers [ $ name ] ) -> serialize ( $ jws , $ recipientIndex ) ; }
Converts a JWE into a string.
Throws an exception if none of the serializer was able to convert the input.

@throws \Exception
Converts a JWE into a string . Throws an exception if none of the serializer was able to convert the input .