Skip to main content

UnsupportedVersion

Enum UnsupportedVersion 

Source
#[non_exhaustive]
pub enum UnsupportedVersion { OlderFile { version: u8, }, NewerFile { version: u8, }, OlderKey { version: u8, }, NewerKey { version: u8, }, OlderPublicKey { version: u8, }, NewerPublicKey { version: u8, }, }
Expand description

File-format or key-file version rejection. Carries the raw version byte so callers can inspect it without parsing a formatted string.

The three variant pairs cover three of FerroCrypt’s four independent on-disk version domains (FORMAT.md §11); the fourth — the inner FCA archive version — is a defect of the encrypted payload rather than the outer file, so it surfaces as FormatDefect::UnsupportedArchiveVersion instead:

  • OlderFile / NewerFile — .fcr outer-container version (FORMAT.md §3.1);
  • OlderKey / NewerKey — private-key encoding version (FORMAT.md §8). “Key” rather than “PrivateKey” for backwards compatibility with earlier callers that pattern-match on the variant names;
  • OlderPublicKey / NewerPublicKey — public-key encoding version (FORMAT.md §7). Distinct from the Key pair because the private-key encoding and the public-key encoding are different on-disk shapes that may map to the same logical key-pair suite from different bytes.

Every variant carries one wire version byte and nothing else, which is what lets the enum stay Copy.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

OlderFile

.fcr outer-container version is older than the current release supports.

Fields

§version: u8

Version byte read from the encrypted-file prefix.

§

NewerFile

.fcr outer-container version is newer than the current release supports.

Fields

§version: u8

Version byte read from the encrypted-file prefix.

§

OlderKey

Private-key encoding version is older than the current release accepts.

Fields

§version: u8

Version byte read from the private.key fixed header.

§

NewerKey

Private-key encoding version is newer than the current release accepts.

Fields

§version: u8

Version byte read from the private.key fixed header.

§

OlderPublicKey

Public-key encoding version is older than the current release accepts. Surfaced when a public recipient (Bech32 string or public.key file) is offered for encryption but its key-pair suite is no longer supported by this build. Per FORMAT.md §7 and the symmetry rule in §11, a release must not accept a public key for encryption unless the same key-pair suite remains supported for private-key decryption.

Fields

§version: u8

Version byte read from the decoded recipient payload.

§

NewerPublicKey

Public-key encoding version is newer than the current release accepts. Carries the version byte read from offset 0 of the decoded recipient payload.

Fields

§version: u8

Version byte read from the decoded recipient payload.

Trait Implementations§

Source§

impl Clone for UnsupportedVersion

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 Copy for UnsupportedVersion

Source§

impl Debug for UnsupportedVersion

Source§

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

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

impl Display for UnsupportedVersion

Source§

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

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

impl Eq for UnsupportedVersion

Source§

impl PartialEq for UnsupportedVersion

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for UnsupportedVersion

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.