verify static method
Implementation
static Future<Package> verify(
Token token, {
required PublicKey publicKey,
}) async {
final payload = token.payloadPublic;
if (payload == null) {
throw UnsupportedError('Invalid payload');
}
final isValid = await Ed25519().verify(
token.standardPreAuthenticationEncoding,
signature: Signature(
payload.signature!,
publicKey: publicKey,
),
);
if (!isValid) {
throw Exception('Invalid signature');
}
return Package(
content: payload.message,
footer: token.footer,
);
}