pub struct UnsignedPayload {
pub timestamp: SystemTime,
pub message_hash: Hash,
pub message_length: u64,
pub app_metadata: Vec<u8>,
}Expand description
Passed to Sulid::sign to create an sULID.
Fields§
§timestamp: SystemTimeThe timestamp portion of the sULID will be based on this. It is also part of the signed payload, to prevent tampering after signing.
message_hash: HashA hash of the message being signed.
message_length: u64The length of the content being signed, in bytes.
app_metadata: Vec<u8>For basic use, you may leave this field empty.
You may optionally add extra, application-specific metadata to the signed payload. This is useful if you want to make sure this data can be read and verified along with the sULID before the main content is fetched/validated/displayed.
As an example, you may want to include a Content-Type style header to distinguish
different types of signed content.
You might also want to include an application-specific marker to distinguish signatures in that context from other signatures.
Note that this crate makes no requriements of app_metadata other than that you must be able to reproduce it to verify an sULID. Make sure any data included here has a canonical form, so that you can reproduce it reliably.