verifySerialized method

  1. @override
bool verifySerialized(
  1. Uint8List message,
  2. String signature,
  3. Uint8List publicKey
)
override

Verify serialized signature

Implementation

@override
bool verifySerialized(Uint8List message, String signature, Uint8List publicKey) {
  final parsed = parseSerializedSignature(signature);
  if (parsed.signatureScheme != SignatureScheme.Ed25519) {
    throw ArgumentError('Invalid signature scheme');
  }

  if (base64Encode(publicKey) != parsed.pubKey!.toBase64()) {
    throw ArgumentError('Signature does not match public key');
  }

  return verify(message, parsed.signature, publicKey);
}