computeSharedSecret method

  1. @override
Future<StringResult> computeSharedSecret(
  1. String privateKey,
  2. String peerPublicKey
)
override

Implementation

@override
Future<StringResult> computeSharedSecret(
    String privateKey, String peerPublicKey) async {
  final result = await  _methodChannel
      .invokeMethod<Map<dynamic, dynamic>?>('computeSharedSecret', {
    'privateKey': privateKey,
    'peerPublicKey': peerPublicKey,
  });
  if ( result == null
    || result["sharedSecret"] == null
    ) {
    throw PlatformException(code: "computeSharedSecret(): error retrieving sharedSecret");
    }
    return StringResult(result["sharedSecret"]);
}