| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Jose\Component\Signature\Serializer; |
| 6 | |
| 7 | use Jose\Component\Signature\JWS; |
| 8 | |
| 9 | interface JWSSerializer |
| 10 | { |
| 11 | /** |
| 12 | * The name of the serialization. |
| 13 | */ |
| 14 | public function name(): string; |
| 15 | |
| 16 | public function displayName(): string; |
| 17 | |
| 18 | /** |
| 19 | * Converts a JWS into a string. |
| 20 | */ |
| 21 | public function serialize(JWS $jws, ?int $signatureIndex = null): string; |
| 22 | |
| 23 | /** |
| 24 | * Loads data and return a JWS object. |
| 25 | * |
| 26 | * @param string $input A string that represents a JWS |
| 27 | */ |
| 28 | public function unserialize(string $input): JWS; |
| 29 | } |