-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: ipfs key sign|verify #10235
Merged
Merged
feat: ipfs key sign|verify #10235
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d91bf93
wip: key sign & verify
hacdias b1ce901
refactor: add command to coreiface, consistent with others
hacdias ba04e60
feat: add coreapi tests for verify and sign
hacdias dec956e
refactor: use assert and require in key tests
hacdias 5c12139
docs: add changelog entry
hacdias f1d5318
docs: add comments to interface
hacdias 6970e2c
chore: apply @lidel feedback, tests
hacdias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we devise a human readable combined scheme ?
$PEERID-$SIG
?Can't use PEERID for RSA but else should be fine.
Else for ECC you can omit the public key entirely and do public key recovery (so we would print the signer's PeerID instead of saying correct or incorrect).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the signature to include the peer ID such that we do not need to provide the key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, forget the ECC thing it's not what we are trying to do right now.
Instead of
-key Qmfoo -sig zMM...
Qmfoo-zMM
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jorropo I see how that could be nice: a single signature that already includes the key, a single value to pass around. However, I think whoever is trying to verify the signature always knows which Peer ID they want to verify it against.
It would also make it harder to choose your own key by name to verify, no?
Just trying to see what would be best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you mean, if it already contains the key, why do I need to specify the peer id ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want this API to accept
key
as a pet name (ipfs key list
) or the actual libp2p-key (peerid).Combining key and sig into a single arg makes the meaning of
mfoo-mbar-mbuz
ambiguous because we allow-
in pet names AND mbase64url:mfoo
ormfoo-mbar
?mbar-mbuz
ormbuz
? (mind that-
is part of base64url alphabet)Someone would have to invent additional syntax or parsing rules for this.
My suggestion is to avoid sinking unnecessary time into answering these questions and writing tests for all edge cases – keep it simple, use separate params.