toCanonicalSignatureJson method
Returns the stable JSON payload used for signing and verification.
When signature is present, its value is blanked before sorting so the signature signs the descriptor envelope rather than itself.
Implementation
Map<String, dynamic> toCanonicalSignatureJson() {
final json = toJson();
final existingSignature = signature;
if (existingSignature != null) {
json["signature"] = existingSignature.copyWith(value: "").toJson();
}
return sortJsonValue(json) as Map<String, dynamic>;
}