@@ -38,9 +38,9 @@ Future<KeyPair<EcdhPrivateKeyImpl, EcdhPublicKeyImpl>> ecdhPrivateKey_generateKe
3838 EllipticCurve curve,
3939) async {
4040 final p = _generateEcKeyPair (curve);
41- return _KeyPair (
42- privateKey : _EcdhPrivateKeyImpl (p.privateKey),
43- publicKey : _EcdhPublicKeyImpl (p.publicKey),
41+ return createKeyPair (
42+ _EcdhPrivateKeyImpl (p.privateKey),
43+ _EcdhPublicKeyImpl (p.publicKey),
4444 );
4545}
4646
@@ -80,8 +80,11 @@ final class _StaticEcdhPrivateKeyImpl implements StaticEcdhPrivateKeyImpl {
8080 ecdhPrivateKey_importJsonWebKey (jwk, curve);
8181
8282 @override
83- Future <KeyPair <EcdhPrivateKeyImpl , EcdhPublicKeyImpl >> generateKey (EllipticCurve curve) =>
84- ecdhPrivateKey_generateKey (curve);
83+ Future <(EcdhPrivateKeyImpl , EcdhPublicKeyImpl )> generateKey (EllipticCurve curve) async {
84+ final KeyPair <EcdhPrivateKeyImpl , EcdhPublicKeyImpl > keyPair = await ecdhPrivateKey_generateKey (curve);
85+
86+ return (keyPair.privateKey, keyPair.publicKey);
87+ }
8588}
8689
8790final class _EcdhPrivateKeyImpl implements EcdhPrivateKeyImpl {
@@ -100,7 +103,7 @@ final class _EcdhPrivateKeyImpl implements EcdhPrivateKeyImpl {
100103 throw ArgumentError .value (
101104 publicKey,
102105 'publicKey' ,
103- 'custom implementations of EcdhPublicKeyImpl is not supported' ,
106+ 'custom implementations of EcdhPublicKey is not supported' ,
104107 );
105108 }
106109 if (length <= 0 ) {
0 commit comments