File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,19 @@ abstract class EcdhPrivateKey {
182
182
return impl.ecdhPrivateKey_generateKey (curve);
183
183
}
184
184
185
+ /// Derive a shared secret from two ECDH key pairs using the private key from one pair
186
+ /// and the public key from another.
187
+ ///
188
+ /// The shared secret is identical whether using A's private key and B's public key,
189
+ /// or B's private key and A's public key, enabling secure key exchange between the
190
+ /// two parties.
191
+ ///
192
+ /// [length] specifies the length of the derived secret in bits.
193
+ /// [publicKey] is [EcdhPublicKey] from the other party's ECDH key pair.
194
+ ///
195
+ /// Returns a [Uint8List] containing the derived shared secret.
196
+ ///
197
+ /// {@macro EcdhPrivateKey:example}
185
198
// Note some webcrypto implementations (chrome, not firefox) supports passing
186
199
// null for length (in this primitive). However, you can always know the right
187
200
// length from the curve. Note p512 can provide up to: 528 bits!!!
You can’t perform that action at this time.
0 commit comments