Skip to content

Add correct payload to SDJwtVcInstance #189

@cre8

Description

@cre8

When decoding an sd-jwt-vc credential with

const sdjwtvc = await sdjwt.decode(credential.credential as string);
console.log(sdjwtvc.jwt!.payload!.jti);

it will throw an error that jti comes from an index signature. It would be correct that we pass SdJwtVcPayload to the decode function so it knows that the default values from a JWT can be set.

Current solution is to cast it manually like console.log((sdjwtvc.jwt!.payload as SdJwtVcPayload).jti);

According to the SD-JWT-VC spec, jti is not a known value, but according to the JWT spec it is. Should we also add all values that are in a JWT also to the payload of a Sdjwtvc? Of course marking them all as optional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions