createVerifyConsumer abstract method
Creates a StreamConsumer for verifying a signature from a stream.
The returned VerificationConsumer is basically a typed StreamConsumer,
that wraps the signature streaming APIs. Creating the consumer will call
crypto_sign_init, adding messages to it via SignatureConsumer.addStream
will call crypto_sign_update for every event in the stream. After you are
done adding messages, you can SignatureConsumer.close it, which will
call crypto_sign_final_verify internally and return whether the given
signature
is correct for the received data, based on publicKey
.
For simpler usage, if you only have a single input Stream and simply want to check if the signature is valid, you ca use verifyStream instead.
See https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#multi-part-messages
Implementation
VerificationConsumer createVerifyConsumer({
required Uint8List signature,
required Uint8List publicKey,
});