pub enum EncryptionUnsupported {
Handler(String),
NoFilter,
UndocumentedAlgorithm(i64),
CipherNotImplemented(&'static str),
UnknownCfm(String),
Malformed(&'static str),
}Expand description
Why pdfcer will not decrypt a particular document.
Every variant names the configuration, not the capability. An operator holding a file that another viewer opens needs to know which of “pdfcer hasn’t implemented this yet”, “this is a different security handler” and “no conforming reader may open this” applies — those have three different next actions.
Variants§
Handler(String)
/Filter names a handler other than /Standard.
The public-key handler (/SubFilter beginning adbe.pkcs7.) lands
here; so does any third-party handler.
NoFilter
/Filter is absent.
Table 20 makes /Filter required: “If this entry is absent,
other security handlers shall not decrypt the document.” This is a
conformance-correct refusal — no reader is permitted to open it.
UndocumentedAlgorithm(i64)
/V 0 (including absent, whose default is 0) or /V 3.
/V 0 is “undocumented”; /V 3 is “an unpublished algorithm … shall
not appear in a conforming PDF file”. Neither is openable by anyone
except the producer.
CipherNotImplemented(&'static str)
A cipher pdfcer recognises but has not implemented. A capability gap with a known shape.
The parenthetical names what is covered, because “AES-256 is not
implemented” alone invites the reading that pdfcer cannot open encrypted
files at all. It said “this increment covers RC4 only” until increment 2
implemented AES-128 and made that false, and named only RC4 and AES-128
until increment 3 implemented AES-256 at /R 5 — a message that
describes the implementation’s scope has to be revisited whenever the
scope moves, so it is deliberately phrased as a capability list rather
than as an increment number.
No configuration reaches this variant today. It is kept rather than
deleted because Table 25’s /CFM set is closed and pdfcer now implements
all four of its values, but the next thing the standard adds will
land here, and a recognised-but-unimplemented cipher is a genuinely
different fact from Self::UnknownCfm’s unrecognised one.
UnknownCfm(String)
/CFM outside the four names Table 25 defines.
Table 25 puts a shall on the diagnostic here, unusually:
applications “shall report that the file is encrypted with an
unsupported algorithm”.
Malformed(&'static str)
The /Encrypt dictionary is missing an entry the algorithms need, or
holds a value of the wrong type.
N6: ISO 32000-1 states no error model for this at all — no clause
says what a reader should do when /O is the wrong length or /R
disagrees with /V. Refusing with the specific field named is pdfcer
policy.
Trait Implementations§
Source§impl Clone for EncryptionUnsupported
impl Clone for EncryptionUnsupported
Source§impl Debug for EncryptionUnsupported
impl Debug for EncryptionUnsupported
Source§impl Display for EncryptionUnsupported
impl Display for EncryptionUnsupported
impl Eq for EncryptionUnsupported
Source§impl Error for EncryptionUnsupported
impl Error for EncryptionUnsupported
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()