matchAsymmetricKeys static method

bool matchAsymmetricKeys(
  1. SignKey sKey,
  2. VerifyKey pKey
)

Verifies that an asymmetric key pair (sign/verify) are a matching pair.

Tests if the private (signing) key can sign the PROMISE data, and the public (verification) key can successfully verify that signature.

sKey is the private/signing key to test. pKey is the public/verification key to test.

Returns true if keys are a valid matching pair, false otherwise.

Implementation

static bool matchAsymmetricKeys(SignKey sKey, VerifyKey pKey) {
  // verify with signature
  Uint8List signature = sKey.sign(PROMISE);
  return pKey.verify(PROMISE, signature);
}