JWS 2 (20.01.2023 3M) Flashcards
What parts does JWS consist of?
- JOSE Header
- JWS Payload
- JWS Signature
What parts does JOSE Header consist of?
In case of JWS Compact Serializtion JOSE Header = JWS Protected Header. And JWS Unprotected Header is not used at all.
In case of JWS Json Serialization logically JOSE Header is union of members of JWS Protected Header and JWS Unprotected Header. But technically JWS Protected Header and JWS Unprotected Header are stored as separate structures.
What is the difference between JWS Unprotected Header and JWS Protected Header? Do all serialization support both headers?
- The difference is JWS Protected Header is a part of signing data along with JWS Payload. When JWS Unprotected Header is not.
- No, JWS Unprotected Header is supported only by JWS JSON Serialization.
What is JWS signing input?
The input to the digital signature or MAC computation. Its value is ASCII(BASE64URL(UTF8(JWS Protected Header)) || ‘.’ || BASE64URL(JWS Payload))
Give JWS Compact Serialization Overview.
In the JWS Compact Serialization, no JWS Unprotected Header is used. In this case, the JOSE Header and the JWS Protected Header are the same.
In the JWS Compact Serialization, a JWS is represented as the concatenation:
BASE64URL(UTF8(JWS Protected Header)) || ‘.’ ||
BASE64URL(JWS Payload) || ‘.’ ||
BASE64URL(JWS Signature)
Give JWS JSON Serialization Overview. Tell about JOSE Header, about representation and representation members.
In the JWS JSON Serialization, one or both of the JWS Protected Header and JWS Unprotected Header MUST be present. In this case, the members of the JOSE Header are the union (logically) of the members of the JWS Protected Header and the JWS Unprotected Header values that are present.
In the JWS JSON Serialization, a JWS is represented as a JSON object
containing some or all of these four members:
- “protected”, with the value BASE64URL(UTF8(JWS Protected Header))
- “header”, with the value JWS Unprotected Header
- “payload”, with the value BASE64URL(JWS Payload)
- “signature”, with the value BASE64URL(JWS Signature)
Notice that “header” is only one not BASE64URL value and it is JSON object.
The example above is flattened JSON Serialization, which may be used only to convey a single signrature.
But you can use multiple signatures then members will be:
1. “payload”, with the value BASE64URL(JWS Payload)
2. “signatures” array of objects with members:
2.1 “protected”, with the value BASE64URL(UTF8(JWS Protected Header))
2.2 “header”, with the value JWS Unprotected Header
2.3 “signature”, with the value BASE64URL(JWS Signature)
As you can see there is a JOSE Header for every signature
Must JWS Payload be JSON value?
JWS Payload can be any sequence of octets that need not be a representation of a JSON object.