Skip to content

feat: Update signer-function logic to be more dynamic #103

@cre8

Description

@cre8

Right now I can pass a signer function to request the required key on demand like this example with veramo:

    const signer: Signer = async (data: string) => context.agent.keyManagerSign({ keyRef: key.kid, data })
    const sdjwt = new SDJwtInstance({
      signer,
      hasher: this.algorithms.hasher,
      saltGenerator: this.algorithms.salltGenerator,
      signAlg: alg,
  })

The problem is, that the signAlg is a static value so I am not able to use any other sign algorithm in my signer.

Suggestion

The signer will return not just the signature, but also the used signAlgorithm. This would allow a more dynamic approach
We could think about using this approach also for the hasher, beside the specification of sd-jwt is limited to sha-256. But It would make this approach more generalised when we change it now for the signature

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