Skip to main content

Checkpoint

Struct Checkpoint 

Source
pub struct Checkpoint {
    pub origin: String,
    pub tree_size: u64,
    pub root_hash: Sha256Hash,
    pub other_content: Vec<String>,
    pub signatures: Vec<CheckpointSignature>,
    pub signed_note_text: String,
}
Expand description

A checkpoint (signed tree head) from a transparency log.

Also known as a “signed note” in the Go ecosystem. Contains the log state (origin, tree size, root hash) plus one or more cryptographic signatures.

Fields§

§origin: String

The origin string identifying the log (e.g., “rekor.sigstore.dev - 2605736670972794746”)

§tree_size: u64

Tree size (number of leaves/entries in the log)

§root_hash: Sha256Hash

Root hash of the Merkle tree (32 bytes SHA-256)

§other_content: Vec<String>

Other data lines (optional extension data, e.g., “Timestamp: 1689177396617352539”)

§signatures: Vec<CheckpointSignature>

Signatures over the checkpoint

§signed_note_text: String

Raw text of the checkpoint body (used for signature verification). This is the text before the blank line separator, with trailing newline.

Implementations§

Source§

impl Checkpoint

Source

pub fn from_text(text: &str) -> Result<Self>

Parse a checkpoint from its text representation

Format:

<origin>
<tree_size>
<root_hash_base64>
[other_content...]

— <key_id_base64> <sig_base64>
[additional signatures...]
Source

pub fn to_signed_note_body(&self) -> String

Encode the checkpoint to its text representation (without signatures).

This returns the signed note body that can be used for signature verification.

Source

pub fn find_signature_by_key_hint( &self, key_hint: &KeyHint, ) -> Option<&CheckpointSignature>

Find a signature matching the given key hint (key ID).

The key hint is the first 4 bytes of SHA-256(public_key_der). Returns the signature if found, or None if no matching signature exists.

Source

pub fn signed_data(&self) -> &[u8]

Get the raw signed note text for signature verification.

This is the checkpoint body (before the blank line) with trailing newline, which is what gets signed.

Trait Implementations§

Source§

impl Clone for Checkpoint

Source§

fn clone(&self) -> Checkpoint

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Checkpoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Checkpoint

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Checkpoint

Source§

fn eq(&self, other: &Checkpoint) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Checkpoint

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Checkpoint

Source§

impl StructuralPartialEq for Checkpoint

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,