Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disclosure digest should be accessible without providing Hasher #150

Closed
c2bo opened this issue Mar 9, 2024 · 1 comment · Fixed by #151
Closed

Disclosure digest should be accessible without providing Hasher #150

c2bo opened this issue Mar 9, 2024 · 1 comment · Fixed by #151
Assignees

Comments

@c2bo
Copy link

c2bo commented Mar 9, 2024

For a holder, you receive the Disclosures with digests and right now can't easily access the digests of disclosures (private member). The only way to access a digest, is via calling digest which requires a HaserAndAlg as input

  public async digest(hash: HasherAndAlg): Promise<string> {
    const { hasher, alg } = hash;
    if (!this._digest) {
      const hash = await hasher(this.encode(), alg);
      this._digest = Uint8ArrayToBase64Url(hash);
    }
    return this._digest;
  }

I do think it would be beneficial to make either the variable directly accessible (public) or change the signature of the function to have hash as an optional argument as it is only used when computing a new digest.

@lukasjhan
Copy link
Member

Hi @c2bo. That's a really good suggestion. I too am having difficulty implementing a feature in PEX.
I think we should make them public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants