Skip to main content

VerifyResult

Struct VerifyResult 

Source
pub struct VerifyResult<'ctx> { /* private fields */ }
Expand description

Result of a verify (or decrypt) operation. Owns the verify-op handle until drop; methods read out the per-signature / per-recipient state.

It also owns the op’s inputs and output, moved here by VerifyOp::execute. Drop destroys the op handle first and the streams after — the canonical upstream ordering — so nothing the op references is freed early.

Implementations§

Source§

impl<'ctx> VerifyResult<'ctx>

Source

pub fn context(&self) -> &Context

Borrow the underlying context (for follow-up find_key etc.).

Source

pub fn signature_count(&self) -> Result<usize>

Number of signatures found in the verified stream.

Source

pub fn signature_at(&self, idx: usize) -> Result<Option<VerifySignature>>

Borrow the per-signature result at idx.

Source

pub fn signatures(&self) -> Result<Vec<VerifySignature>>

All per-signature results.

Source

pub fn iter_signatures(&self) -> impl Iterator<Item = VerifySignature> + '_

Lazy iterator over per-signature results. Skips holes (returns None for any index where librnp returns no handle) — use the strict Self::signatures collector if holes are unexpected.

Source

pub fn any_valid(&self) -> Result<bool>

True iff at least one signature verified successfully.

Source

pub fn recipient_count(&self) -> Result<usize>

Number of public-key recipients in the verified stream.

Source

pub fn recipient_at(&self, idx: usize) -> Result<Option<Recipient>>

Source

pub fn recipients(&self) -> Result<Vec<Recipient>>

Source

pub fn used_recipient(&self) -> Result<Option<Recipient>>

The recipient that was actually used for decryption, if any.

Source

pub fn symenc_count(&self) -> Result<usize>

Number of symmetric-only encrypted session keys (password-based recipients) in the verified stream.

Source

pub fn symenc_at(&self, idx: usize) -> Result<Option<Symenc>>

Source

pub fn symencs(&self) -> Result<Vec<Symenc>>

Source

pub fn used_symenc(&self) -> Result<Option<Symenc>>

The symenc that was actually used for decryption, if any.

Source

pub fn file_info(&self) -> Result<Option<FileInfo>>

File metadata embedded in the literal-data packet, if any.

Source

pub fn format(&self) -> Result<char>

Format character of the verified message ('b' binary, 't' text, 'u' UTF-8, etc. — see RFC 4880 §5.9). Returns '\0' if unknown.

Source

pub fn protection_info(&self) -> Result<(String, String, bool)>

Protection info (mode, cipher, valid) of the encrypted stream. mode is one of "none", "cfb", "cfb-mdc", "aead-ocb", "aead-eax". valid is true iff MDC/AEAD integrity was verified.

Trait Implementations§

Source§

impl<'ctx> Drop for VerifyResult<'ctx>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'ctx> !RefUnwindSafe for VerifyResult<'ctx>

§

impl<'ctx> !Send for VerifyResult<'ctx>

§

impl<'ctx> !Sync for VerifyResult<'ctx>

§

impl<'ctx> !UnwindSafe for VerifyResult<'ctx>

§

impl<'ctx> Freeze for VerifyResult<'ctx>

§

impl<'ctx> Unpin for VerifyResult<'ctx>

§

impl<'ctx> UnsafeUnpin for VerifyResult<'ctx>

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> 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, 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, <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.