feat(identity): add sign and verify subcommands#64
Draft
geekgonecrazy wants to merge 2 commits into
Draft
Conversation
atomic identity sign reads bytes from stdin and outputs a JSON object with a base64 Ed25519 signature, the identity's base32 public key, the identity name, and alg field. --identity selects a non-default identity; omitting it uses whoami. atomic identity verify takes --signature <base64> and --public-key <base32>, reads bytes from stdin, and exits 0 (valid) or 1 (invalid).
e1b4f3e to
955fa57
Compare
955fa57 to
cb8ad13
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds two subcommands under
atomic identityfor signing and verifying arbitrary bytes using an identity's Ed25519 keypair.atomic identity signReads raw bytes from stdin, signs them with the identity's Ed25519 secret key, and prints a JSON object:
{ "signature": "<base64-encoded Ed25519 signature>", "public_key": "<base32-encoded public key>", "identity": "alice-work", "alg": "ed25519" }--identity <name>selects a non-default identity. Omitting it uses the current default (whoami).atomic identity verifyReads raw bytes from stdin and verifies a signature against a public key. Exits
0if valid,1if invalid.The
--public-keyflag takes the base32 public key from asignoutput. The--signatureflag takes the base64 signature field.Test plan
atomic identity signproduces valid JSON with all four fieldssignpipes directly intoverifyand exits 0verifyexits 1 when the payload is tamperedverifyexits 1 when the wrong public key is suppliedsign --identity <name>uses the specified identity, not the defaultsignwith no default identity set returns a helpful error message