Trait TimeStampProvider

Source
pub trait TimeStampProvider {
    // Provided methods
    fn time_stamp_service_url(&self) -> Option<String> { ... }
    fn time_stamp_request_headers(&self) -> Option<Vec<(String, String)>> { ... }
    fn time_stamp_request_body(
        &self,
        message: &[u8],
    ) -> Result<Vec<u8>, TimeStampError> { ... }
    fn send_time_stamp_request(
        &self,
        message: &[u8],
    ) -> Option<Result<Vec<u8>, TimeStampError>> { ... }
}
Expand description

A TimeStampProvider implementation can contact a RFC 3161 time stamp service and generate a corresponding time stamp for a specific piece of data.

Provided Methods§

Source

fn time_stamp_service_url(&self) -> Option<String>

Return the URL for time stamp service.

Source

fn time_stamp_request_headers(&self) -> Option<Vec<(String, String)>>

Additional request headers to pass to the time stamp service.

IMPORTANT: You should not include the “Content-type” header here. That is provided by default.

Source

fn time_stamp_request_body( &self, message: &[u8], ) -> Result<Vec<u8>, TimeStampError>

Generate the request body for the HTTPS request to the time stamp service.

Source

fn send_time_stamp_request( &self, message: &[u8], ) -> Option<Result<Vec<u8>, TimeStampError>>

Request a RFC 3161 time stamp over an arbitrary data packet.

The default implementation will send the request to the URL provided by Self::time_stamp_service_url(), if any.

todo: THIS CODE IS NOT COMPATIBLE WITH C2PA 2.x sigTst2

Implementors§