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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
0a0ce8f7
You need to sign in or sign up before continuing.
Commit
0a0ce8f7
authored
2 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Add ImportPrivateIdentity to channels bindings
parent
e9213705
No related branches found
No related tags found
3 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!340
Project/channels
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/channels.go
+17
-0
17 additions, 0 deletions
bindings/channels.go
with
17 additions
and
0 deletions
bindings/channels.go
+
17
−
0
View file @
0a0ce8f7
...
...
@@ -126,6 +126,23 @@ func GenerateChannelIdentity(cmixID int) ([]byte, error) {
return
pi
.
Marshal
(),
nil
}
// ImportPrivateIdentity generates a new [channel.PrivateIdentity] from exported
// data.
//
// Parameters:
// - password - The password used to encrypt the identity.
// - data - The encrypted data.
//
// Returns:
// - JSON of [channel.PrivateIdentity].
func
ImportPrivateIdentity
(
password
string
,
data
[]
byte
)
([]
byte
,
error
)
{
pi
,
err
:=
cryptoChannel
.
ImportPrivateIdentity
(
password
,
data
)
if
err
!=
nil
{
return
nil
,
err
}
return
pi
.
Marshal
(),
nil
}
// GetPublicChannelIdentity constructs a public identity ([channel.Identity])
// from a bytes version and returns it JSON marshaled.
//
...
...
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
register
or
sign in
to comment