Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Merge requests
!172
[feat] conf: new option for create a key WITH seed added
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Closed
[feat] conf: new option for create a key WITH seed added
counter/122-keys-subcommand-create-keypair-from-seed
into
dev
Overview
6
Commits
1
Pipelines
0
Changes
2
4 unresolved threads
Hide all comments
Closed
Ghost User
requested to merge
counter/122-keys-subcommand-create-keypair-from-seed
into
dev
6 years ago
Overview
6
Commits
1
Pipelines
0
Changes
2
4 unresolved threads
Hide all comments
close
#122
Edited
6 years ago
by
Éloïs
0
0
Merge request reports
Compare
dev
version 6
7664a54e
6 years ago
version 5
2af1af7b
6 years ago
version 4
2af1af7b
6 years ago
version 3
927f6939
6 years ago
version 2
da57b26f
6 years ago
version 1
a0be89c3
6 years ago
dev (base)
and
version 3
latest version
7664a54e
1 commit,
5 years ago
version 6
7664a54e
1 commit,
6 years ago
version 5
2af1af7b
1 commit,
6 years ago
version 4
2af1af7b
1 commit,
6 years ago
version 3
927f6939
1 commit,
6 years ago
version 2
da57b26f
1 commit,
6 years ago
version 1
a0be89c3
1 commit,
6 years ago
2 files
+
73
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
lib/core/conf/src/keys.rs
+
39
−
0
View file @ 927f6939
Show full file
@@ -39,6 +39,45 @@ impl From<std::io::Error> for WizardError {
WizardError
::
BadInput
}
}
///Ask for salt for seed
pub
fn
ask_seed_salt
()
->
String
{
println!
(
"type the seed salt"
);
let
input_salt
:
String
=
rpassword
::
prompt_password_stdout
(
"Password: "
)
.expect
(
"Failed to read password"
);
input_salt
}
///Create a key with a seed
pub
fn
create_key
()
->
DuniterKeyPairs
{
println!
(
"type the seed password"
);
let
seed_password
:
String
=
rpassword
::
prompt_password_stdout
(
"Password: "
)
.expect
(
"Failed to read password"
);
println!
(
"type the seed salt"
);
let
seed_salt
:
String
=
rpassword
::
prompt_password_stdout
(
"Password: "
)
.expect
(
"Failed to read password"
);
let
key_generator
=
dup_crypto
::
keys
::
ed25519
::
KeyPairFromSaltedPasswordGenerator
::
with_default_parameters
();
let
seed
:
[
u8
;
32
]
=
key_generator
.generate_seed
(
seed_password
.as_bytes
(),
seed_salt
.as_bytes
());
println!
(
"type the key password:"
);
let
input_password
:
String
=
rpassword
::
prompt_password_stdout
(
"Password: "
)
.expect
(
"Failed to read password"
);
DuniterKeyPairs
{
network_keypair
:
KeyPairEnum
::
Ed25519
(
ed25519
::
KeyPairFromSaltedPasswordGenerator
::
with_default_parameters
()
.generate
(
input_password
.as_bytes
(),
&
seed
),
),
member_keypair
:
Some
(
KeyPairEnum
::
Ed25519
(
ed25519
::
KeyPairFromSaltedPasswordGenerator
::
with_default_parameters
()
.generate
(
input_password
.as_bytes
(),
&
seed
),
)),
}
}
/// Modify network keys command
pub
fn
modify_network_keys
(
Loading