Skip to content
Snippets Groups Projects
Commit 0a0ce8f7 authored by Jono Wenger's avatar Jono Wenger
Browse files

Add ImportPrivateIdentity to channels bindings

parent e9213705
No related branches found
No related tags found
3 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!340Project/channels
......@@ -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.
//
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment