Closed
Description
Hi! I want to sign binary data in payload.
Payload is detached and headers are:
['b64' => false, 'crit' => ['b64']].
$jwsBuilder = new JWSBuilder([new PS256]);
$jwsBuilder = $jwsBuilder->create()->withPayload($binaryPayload, true);
This causes new InvalidArgumentException('The payload must be encoded in UTF-8');
When i get rid of that exception by manually deleting it signing and verifying just works fine.
rfc7797 should allow binary detached payload.
https://datatracker.ietf.org/doc/html/rfc7797#section-5.1
A detached payload can contain any octet sequence representable by the application.
Am I doing something wrong or should the UTF-8 check only be done with nondetached payloads?
Best Regards