#[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—.fcrouter-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 theKeypair 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
OlderFile
.fcr outer-container version is older than the current release
supports.
NewerFile
.fcr outer-container version is newer than the current release
supports.
OlderKey
Private-key encoding version is older than the current release accepts.
NewerKey
Private-key encoding version is newer than the current release accepts.
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.
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.