From 70613956d7e8ee48e72cc1699d3d5843517b5f37 Mon Sep 17 00:00:00 2001 From: BruceJian43 Date: Sun, 11 Jan 2026 14:44:40 +0800 Subject: [PATCH] docs: replace newSecretKey with newKeyPair in Ecdsa example. --- cryptography/lib/src/cryptography/algorithms.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cryptography/lib/src/cryptography/algorithms.dart b/cryptography/lib/src/cryptography/algorithms.dart index 0681741..a55b964 100644 --- a/cryptography/lib/src/cryptography/algorithms.dart +++ b/cryptography/lib/src/cryptography/algorithms.dart @@ -1068,20 +1068,19 @@ abstract class Ecdh extends KeyExchangeAlgorithm { /// // In this example, we use ECDSA-P256-SHA256 /// final algorithm = Ecdsa.p256(Sha256()); /// -/// // Generate a random key pair -/// final secretKey = await algorithm.newSecretKey(); -/// final publicKey = await algorithm.publicKey(secretKey); +/// // Generate a key pair +/// final keyPair = await algorithm.newKeyPair(); /// /// // Sign a message /// final message = [1,2,3]; /// final signature = await algorithm.sign( -/// [1,2,3], -/// secretKey: secretKey, +/// message, +/// keyPair: keyPair, /// ); /// /// // Anyone can verify the signature -/// final isVerified = await algorithm.verify( -/// message: message, +/// final isSignatureCorrect = await algorithm.verify( +/// message, /// signature: signature, /// ); /// }