validateSignedCacao method
Implementation
@override
Future<bool> validateSignedCacao({
required Cacao cacao,
required String projectId,
}) async {
final CacaoSignature signature = cacao.s;
final CacaoPayload payload = cacao.p;
final reconstructed = formatAuthMessage(
iss: payload.iss,
cacaoPayload: CacaoRequestPayload.fromCacaoPayload(payload),
);
final walletAddress = AddressUtils.getDidAddress(payload.iss);
final chainId = AddressUtils.getDidChainId(payload.iss);
final isValid = await AuthSignature.verifySignature(
walletAddress.toEIP55(),
reconstructed,
signature,
chainId,
projectId,
);
return isValid;
}