Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
bad230f8
Commit
bad230f8
authored
Sep 9, 2021
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Add bindings logic
parent
a97f2e79
No related branches found
No related tags found
2 merge requests
!23
Release
,
!19
Implement mnemonic in client
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/mnemonic.go
+33
-0
33 additions, 0 deletions
bindings/mnemonic.go
with
33 additions
and
0 deletions
bindings/mnemonic.go
+
33
−
0
View file @
bad230f8
///////////////////////////////////////////////////////////////////////////////
// Copyright © 2020 xx network SEZC //
// //
// Use of this source code is governed by a license that can be found in the //
// LICENSE file //
///////////////////////////////////////////////////////////////////////////////
package
bindings
import
"gitlab.com/elixxir/client/api"
// StoreSecretWithMnemonic stores the secret tied with the mnemonic to storage.
// Unlike other storage operations, this does not use EKV, as that is
// intrinsically tied to client operations, which the user will not have while
// trying to recover their account. As such, we store the encrypted data
// directly, with a specified path. Path will be a valid filepath in which the
// recover file will be stored as ".recovery".
//
// As an example, given "home/user/xxmessenger/storagePath",
// the recovery file will be stored at
// "home/user/xxmessenger/storagePath/.recovery"
func
StoreSecretWithMnemonic
(
secret
[]
byte
,
path
string
)
(
string
,
error
)
{
return
api
.
StoreSecretWithMnemonic
(
secret
,
path
)
}
// LoadSecretWithMnemonic loads the secret stored from the call to
// StoreSecretWithMnemonic. The path given should be the same filepath
// as the path given in StoreSecretWithMnemonic. There should be a file
// in this path called ".recovery". This operation is not tied
// to client operations, as the user will not have a client when trying to
// recover their account.
func
LoadSecretWithMnemonic
(
mnemonic
,
path
string
)
(
secret
[]
byte
,
err
error
)
{
return
api
.
LoadSecretWithMnemonic
(
mnemonic
,
path
)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment