ecdsaDuoKeyExport function
- required String serverEncryptionPublicKey,
- required DklsEncryptionKey clientEncryptionKeys,
Export(Duo) both parties Ekey by merging them and create a private key.
keyshare is the keyshare of the client.
serverEncrptedKeyshare is the encrypted keyshare of the server.
serverEncryptionPublicKey is the public key of the server.
clientEncryptionKey is the DklsEncryptionKey key of the client.
returns the private key in hex format.
Implementation
String ecdsaDuoKeyExport(
{required dkls.DklsKeyshare keyshare,
required String serverEncrptedKeyshare,
required String serverEncryptionPublicKey,
required dkls.DklsEncryptionKey clientEncryptionKeys}) {
final exportSession = new dkls.ExportSession.create(
clientKeyshare: keyshare,
clientEncryptionPrivateKey: clientEncryptionKeys.privateKey,
serverEncryptionPublicKey:
hex.decode(serverEncryptionPublicKey),
encryptedServerKeyshare:
hex.decode(serverEncrptedKeyshare));
final privateKey = exportSession.privateKeyHex;
exportSession.free();
return privateKey;
}