create static method
Signs a register clock with the current device's signing key.
Implementation
static Future<CanvasRegisterClockModel> create({
required String canvasId,
required String objectId,
required CanvasRegisterName registerName,
required String conversationKey,
required String hlcTimestamp,
String? registerJson,
bool? isDeleted,
}) async {
final actorDeviceKey = Signing.instance.publicKey;
final valueDigest = await digestFor(
registerName: registerName,
registerJson: registerJson,
isDeleted: isDeleted,
);
final message = getMessage(
canvasId: canvasId,
objectId: objectId,
registerName: registerName,
conversationKey: conversationKey,
actorDeviceKey: actorDeviceKey,
hlcTimestamp: hlcTimestamp,
valueDigest: valueDigest,
);
final signature = await Signing.instance.signDeviceMessage(message);
return CanvasRegisterClockModel(
canvasId: canvasId,
objectId: objectId,
registerName: registerName,
conversationKey: conversationKey,
actorDeviceKey: actorDeviceKey,
hlcTimestamp: hlcTimestamp,
signature: signature,
);
}