
Read out texts and howtos about software engineering.
Subscribe to our newsletter for exclusive content.
@spec present_credential_map( Crypto.keypair_opt(), map(), list() ) :: {:ok, map()} | {:error, any()} def present_credential_map(%{public: pk} = kp, %{} = credential_map, opts \\ []) do try do p = &Cat.put_new_value(&1, &2, &3) o = &Keyword.get(opts, &1) issuer = DID.one_by_pk!(pk) presentation_claim = %{ "verifiableCredential" => credential_map, "issuer" => issuer |> DID.to_string() } |> p.("id", o.(:location)) |> p.("holder", o.(:holder)) {:ok, Crypto.sign_map!(kp, presentation_claim, opts)} rescue e -> {:error, %{"task" => "find a tag with the flag", "stack trace" => __STACKTRACE__}} end end