Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Add generate credentials#3

Merged
BoisterousCoder merged 4 commits intomainfrom
add-generate-credentials
Oct 26, 2022
Merged

Add generate credentials#3
BoisterousCoder merged 4 commits intomainfrom
add-generate-credentials

Conversation

@BoisterousCoder
Copy link
Copy Markdown
Contributor

@BoisterousCoder BoisterousCoder commented Oct 24, 2022

This PR implements the add generate credentials command.

Testing

To test this command

cargo run generate credentials

The output should produce the ed222519 key pair and its did, which should look something like the following:

✅ Generated an Ed25519 key pair and associated DID
🗝️ Private key: uwBK0fIWYZeg8Dr5gyw8/8Yf0khRxFegIPeWgP2o5jI=
🔑 Public key: ANqzyN5Y33byvfbf6Z7J54Jo1ZQn978YFrIIZbMrSnI=
🆔 DID: did:key:z6M14LRScqxd9a9XWJko3toZy9xQbHxWEo8SCCfy5PRCGFs

Related Issues

Closes #2

@BoisterousCoder BoisterousCoder requested a review from bgins October 24, 2022 20:43
Comment thread src/cmd/generate.rs Outdated
println!("{}", "✅ Generated an Ed25519 key pair and associated DID".bright_green());
println!("🗝️ Private key: {}", private_key_str.bright_blue());
println!("🔑 Public key: {}", public_key_str.bright_blue());
println!("🆔 DID: {}", did.bright_blue());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice job capturing the emoji! 😄

Copy link
Copy Markdown
Contributor

@bgins bgins left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks for implementing this. 🎉 🚀

Comment thread src/cmd/generate.rs Outdated
}

const DID_KEY_PREFIX:&str = "did:key:z";
const DID_KEY_PREFIX_ED25519:[u8; 2] = [237, 1];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh interesting! The existing did-key crates don't have Ed25519?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The one did crate I saw had no documentation and looked unfinished, so I just made my own as it was pretty quick

BoisterousCoder and others added 2 commits October 25, 2022 12:48
fixed an issue. DIdn't know you had to hard code the prefix as a byte and not a string
@BoisterousCoder BoisterousCoder force-pushed the add-generate-credentials branch from 6274e55 to f8a8ebb Compare October 25, 2022 21:52
@BoisterousCoder BoisterousCoder merged commit b1dd07c into main Oct 26, 2022
@BoisterousCoder BoisterousCoder deleted the add-generate-credentials branch January 4, 2023 21:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add generate credentials command

3 participants