Skip to main content

Verified

Struct Verified 

Source
pub struct Verified<'r, 'a> { /* private fields */ }
Available on crate feature verify only.
Expand description

A checked signature.

There is no public constructor: the only way to hold one is to have run verify. That is deliberate — a -> bool API invites a caller to check the boolean in one function and act on the record in another, which is how “verified” quietly becomes “parsed”.

Implementations§

Source§

impl Verified<'_, '_>

Source

pub fn summary(&self) -> RecordSummary

A serialisable report about this record and the check that was run.

Two things Record::summary cannot know: the verdict itself, in RecordSummary::verification, and the three deviation kinds only a signature check can find. The key travels with the verdict, because a report that says “verified” without saying which key has answered half the question.

Source§

impl<'r, 'a> Verified<'r, 'a>

Source

pub const fn record(&self) -> &'r Record<'a>

The record whose signature was checked.

Source

pub const fn payload(&self) -> &'r Payload<'a>

The payload, for readings and fields.

Source

pub const fn key(&self) -> &PublicKey

The key the signature was checked against.

Source

pub const fn algorithm(&self) -> SignatureAlgorithm

The algorithm actually used — from SA, or its default.

Source

pub const fn payload_digest(&self) -> [u8; 32]

SHA-256 of the signed bytes: this record’s identity.

Source

pub fn deviations(&self) -> &[Deviation]

Deviations found while parsing, plus any found while verifying — a non-canonical DER encoding, a bare r‖s, a high-s signature.

Trait Implementations§

Source§

impl<'r, 'a> Clone for Verified<'r, 'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'r, 'a> Debug for Verified<'r, 'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'r, 'a> Forget for Verified<'r, 'a>

§

impl<'r, 'a> Freeze for Verified<'r, 'a>

§

impl<'r, 'a> Move for Verified<'r, 'a>

§

impl<'r, 'a> RefUnwindSafe for Verified<'r, 'a>

§

impl<'r, 'a> Send for Verified<'r, 'a>

§

impl<'r, 'a> Sync for Verified<'r, 'a>

§

impl<'r, 'a> Unpin for Verified<'r, 'a>

§

impl<'r, 'a> UnsafeUnpin for Verified<'r, 'a>

§

impl<'r, 'a> UnwindSafe for Verified<'r, 'a>

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.