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

Simplify DIDComm unpack(), use Key instead of String #1310

Merged
merged 8 commits into from
Dec 11, 2024

Conversation

JamesKEbert
Copy link
Contributor

Refactors

  • Simplifies the DIDComm unpack methods, as there previously used to be separate methods for authcrypt and anoncrypt, however under the hood they both would do authcrypt and anoncrypt unpacking, so the only difference really was that authcrypt would compare whether the sender verkey matched a supplied expected sender verkey (and provide an incorrect impression that only one strategy was being utilized). So I combined them and provided an optional arg for the expected sender verkey check.
  • Additionally, this PR adjusts the usage of Keys to be passed everywhere by Key instead of as String to provide better typing and access to the methods on the Key object. I also added a method to do a match against a given KeyType that will return an error if it is not valid to reduce the overhead of validation needed in a variety of places. Coincidentally this change removes a couple of spots where we go Key -> String -> Key (which is gross).
  • Unpacked message keys are now assumed to be of KeyType ED25519.

…ase58 strings

Signed-off-by: James Ebert <jamesebert.k@gmail.com>
…tead of strings

Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Signed-off-by: James Ebert <jamesebert.k@gmail.com>
Copy link
Contributor

@gmulhearn gmulhearn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@JamesKEbert JamesKEbert merged commit 78dce27 into hyperledger:main Dec 11, 2024
15 checks passed
@JamesKEbert JamesKEbert deleted the feat/useKeys branch December 11, 2024 15:51
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 this pull request may close these issues.

2 participants