Skip to content

Shared test cases

Shared test cases are not atomic test cases. A test case invokes a complete family of them in one scenario step, for example "Perform all Shared_JSON test cases on the decrypted Authorization Response", and their results form the result of that step. See Test Case ID for the convention.

Shared_JSON_01
Objective

Verify the syntactic structure of a JSON structure is valid.

References
  • [RFC8259] section 9
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JSON structure is available.
Test Scenario
  1. Parse the complete JSON structure, using a generic JSON decoder.
Expected results
  1. Parsing is successful and the JSON structure is valid according to RFC 8259.
Comments

Some decoders allow for incremental parsing. This mode should not be used.

Shared_JSON_02
Objective

Verify that any object in the JSON structure does not contain multiple name/value pairs with the same name.

References
  • [RFC8259] section 4
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A syntactically correct JSON structure is available.
Test Scenario
  1. For all JSON objects within the JSON structure, verify whether the object contains multiple name/value pairs with the same name.
Expected results
  1. No object with multiple members with the same name are present in the JSON structure.
Shared_JSON_03
Objective

Verify that the JSON structure is encoded using UTF-8 and does not contain a byte order mark.

References
  • [RFC8259] section 8.1
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A syntactically correct JSON structure is available.
Test Scenario
  1. Verify that the JSON structure is encoded using UTF-8.
  2. Verify that the JSON structure does not contain a byte order mark.
Expected results
  1. The JSON structure is encoded using byte sequence valid for UTF-8 and only encodes code points specified in Unicode.
  2. The JSON structure does not contain a byte order mark (U+FEFF) at the beginning.
Shared_JWT_JWE_01
Objective

Verify the syntactic structure of a JSON Web Encryption using the JWE Compact Serialization is correct.

References
  • [RFC7516] section 7.1
  • [RFC4648] section 5
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWE structure using JWE Compact Serialization is available.
Test Scenario
  1. Verify the number of single period characters (".") in the JWE.
  2. Verify that the five parts of the JWE (as separated by the period characters) are base64url-encoded values as specified in RFC 4648 section 5.
Expected results
  1. The number is equal to 4.
  2. This is the case. The five parts do not contain line breaks, whitespace, or other additional characters.
Shared_JWT_JWE_02
Objective

Verify the syntactic structure of the protected header of a JSON Web Encryption using the JWE Compact Serialization is correct.

References
  • [RFC7516] section 5.2
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWE structure using JWE Compact Serialization is available.
  2. The syntactic structure of that JWE structure is correct.
Test Scenario
  1. Take the first part of the JWE and Base64url-decode it to obtain the JWE Protected Header.
  2. For the JWE Protected Header, perform all Shared_JSON test cases.
Expected results
  1. Decoding is successful.
  2. All test cases pass.
Shared_JWT_JWE_03
Objective

Verify that a JOSE Header is a valid JWE Protected Header.

References
  • [RFC7516] section 4.1
  • [RFC8259] section 4
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWE structure using JWE Compact Serialization is available.
  2. The syntactic structure of that JWE structure is correct.
  3. The syntactic structure of the protected header of that JWE structure is correct.
Test Scenario
  1. Verify that the JOSE Header is a JSON object as specified in RFC 8259 section 4.
  2. Verify the number of members of the JOSE Header.
  3. Verify the members of the JOSE Header.
Expected results
  1. This is the case.
  2. The JOSE header has at least two members.
  3. All members of the JOSE Header have one of the following names:
  4. Mandatorily: alg,
  5. Mandatorily: enc,
  6. Optionally: a Registered Header Parameter name according to RFC 7516 section 4.1, or a Public Header Parameter name registered in the IANA "JSON Web Signature and Encryption Header Parameters" registry (for JWE).
  7. Optionally: any Private Header Parameter.
Shared_JWT_JWS_01
Objective

Verify the syntactic structure of a JSON Web Signature using the JWS Compact Serialization is correct.

References
  • [RFC7515] section 7.1
  • [RFC4648] section 5
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWS structure using JWS Compact Serialization is available.
Test Scenario
  1. Verify the number of single period characters (".") in the JWS.
  2. Verify that the three parts of the JWS (as separated by the period characters) are base64url-encoded values as specified in RFC 4648 section 5.
Expected results
  1. The number is equal to 2.
  2. This is the case. The three parts do not contain line breaks, whitespace, or other additional characters.
Shared_JWT_JWS_02
Objective

Verify that the syntactic structure of the protected header of a JSON Web Signature using the JWS Compact Serialization is correct.

References
  • [RFC7515] section 5.2
  • [RFC4648] section 5
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWS structure using JWS Compact Serialization is available.
  2. The JWS structure is syntactically correct.
Test Scenario
  1. Take the first part of the JWS and Base64url-decode it to obtain the JOSE Header.
  2. For the JOSE Header, perform all Shared_JSON test cases.
Expected results
  1. Decoding is successful.
  2. All test cases pass.
Shared_JWT_JWS_03
Objective

Verify that a JOSE Header is a valid JWS Protected Header.

References
  • [RFC7515] section 4
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWS structure using JWS Compact Serialization is available.
  2. The JWS structure is syntactically correct.
  3. The JOSE Header has the correct syntactic structure of a JWS protected header.
Test Scenario
  1. Verify that the JOSE Header is a JSON object as specified in RFC 8259 section 4.
  2. Verify the number of members of the JOSE Header.
  3. Verify the members of the JOSE Header.
Expected results
  1. The JOSE Header is a JSON object.
  2. The JOSE header has at least one member.
  3. All members of the JOSE Header have one of the following names (and presence):
    1. alg (mandatory)
    2. (optionally) any registered Header Parameter name according to RFC 7515 section 4.1, or a Public Header Parameter name registered in the IANA "JSON Web Signature and Encryption Header Parameters" registry (for JWS).
    3. (optionally) any Private Header Parameter.
Shared_JWT_JWS_04
Objective

Verify that the syntactic structure of the JWT Payload of a JSON Web Token with JSON Web Signature using the JWS Compact Serialization is correct.

References
  • [RFC7519] section 4
  • [RFC7515] section 7.1
  • [RFC4648] section 5
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWS structure using JWS Compact Serialization is available.
  2. The JWS structure is syntactically correct.
Test Scenario
  1. Take the second part of the JWS and Base64url-decode it to obtain the JWS Payload.
  2. For the JWS Payload, perform all Shared_JSON test cases.
Expected results
  1. Decoding is successful.
  2. All test cases pass.
Shared_JWT_JWS_05
Objective

Verify that a JWT Payload is a valid JSON Web Token.

References
  • [RFC7519] section 4
Profile applicability

None

EUDI-wallet relevancy

EUDI_generic | EUDI_required

Preconditions
  1. A JWS structure using JWS Compact Serialization is available.
  2. The JWS structure is syntactically correct.
  3. The JWS Payload has the correct syntactic structure of a JSON Web Token.
Test Scenario
  1. Verify the members of the JWS Payload.
Expected results
  1. All members of the JWS Payload (i.e. the JWT Claims Set) have one of the following names:
    1. A Registered Claim name according to RFC 7519 section 4.1, i.e. iss, sub, aud, exp, nbf, iat or jti.
    2. A Public Claim name registered in the IANA "JSON Web Token Claims" registry.
    3. One of the claims specified for EUDI-wallet, e.g. in a relevant ETSI specification, such as issuing_authority or category.
    4. (optionally) any other Private Claim.