Skip to content
Snippets Groups Projects
Commit 7626dc42 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add converter for the private -> public key for prc servers

parent 9eeebee5
No related branches found
No related tags found
1 merge request!701RPC Module
......@@ -163,6 +163,16 @@ func GenerateRandomRPCKey(cMixID int) ([]byte, error) {
return prk.Bytes(), nil
}
// DeriveRPCPublicKey derives the public key from the given private key
func DeriveRPCPublicKey(privateKey []byte) ([]byte, error) {
prk := ecdh.ECDHNIKE.NewEmptyPrivateKey()
err := prk.FromBytes(privateKey)
if err != nil {
return nil, err
}
return ecdh.ECDHNIKE.DerivePublicKey(prk).Bytes(), nil
}
// LoadRPCServer load key and id from disk and return an RPC server
func LoadRPCServer(cMixID int, callback RPCServerCallback) (
RPCServer, error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment