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

[bug] Unable to Create SDR With DID that Lacks Secp256k1 Key #946

Closed
nickreynolds opened this issue Jun 22, 2022 · 0 comments · Fixed by #1214
Closed

[bug] Unable to Create SDR With DID that Lacks Secp256k1 Key #946

nickreynolds opened this issue Jun 22, 2022 · 0 comments · Fixed by #1214
Labels
bug Something isn't working good first issue Good for newcomers pinned don't close this just for being stale

Comments

@nickreynolds
Copy link
Contributor

nickreynolds commented Jun 22, 2022

async createSelectiveDisclosureRequest(
    args: ICreateSelectiveDisclosureRequestArgs,
    context: IAgentContext<IDIDManager & IKeyManager>,
  ): Promise<string> {
    try {
      const identifier = await context.agent.didManagerGet({ did: args.data.issuer })
      const data: Partial<ISelectiveDisclosureRequest> = args.data
      delete data.issuer
      Debug('veramo:selective-disclosure:create-sdr')('Signing SDR with', identifier.did)

      const key = identifier.keys.find((k) => k.type === 'Secp256k1')
      if (!key) throw Error('Signing key not found')

Observed Behavior:

  • createSelectiveDisclosureRequest throws an error if specified DID does not have an Secp256k1 Key

Expected Behavior:

  • Should be able to create SDRs using any acceptable key type

Version:
@veramo/selective-disclosure @3.1.4@next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers pinned don't close this just for being stale
Projects
None yet
2 participants