#[non_exhaustive]pub enum XmlEncError {
Show 30 variants
Policy(PolicyViolation),
Provider(ProviderError),
XmlParse(Error),
Document(XmlDocumentError),
MissingRequired(&'static str),
InvalidStructure(String),
SelectedNodeUnavailable {
id: String,
},
UnsupportedAlgorithm(String),
Base64(String),
DataTooShort {
algorithm: &'static str,
minimum: usize,
actual: usize,
},
InvalidCbcCiphertextLength(usize),
InvalidPadding,
AeadAuthenticationFailed,
InvalidKeySize {
algorithm: DataEncryptionAlgorithm,
expected: usize,
actual: usize,
},
AmbiguousKeyCandidates {
algorithm: DataEncryptionAlgorithm,
actual: usize,
},
InvalidKekSize {
algorithm: KeyWrapAlgorithm,
expected: usize,
actual: usize,
},
InvalidWrappedKeyLength {
expected: usize,
actual: usize,
},
InvalidEncryptionConfig(String),
KeyNotFound,
EncryptedDataNotFound,
AmbiguousEncryptedData,
EncryptionTargetNotFound,
AmbiguousEncryptionTarget,
ReplacementRequiresXml,
Rsa(String),
RsaEncrypt(String),
KeyWrapIntegrity,
Rng(String),
XmlSerialize(String),
Utf8(FromUtf8Error),
}Expand description
Errors raised while parsing, encrypting, resolving, or decrypting XMLEnc data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Policy(PolicyViolation)
The compiled encryption or decryption policy rejected an operation input.
Provider(ProviderError)
The selected cryptographic provider rejected or failed an operation.
XmlParse(Error)
XML document parsing failed.
Document(XmlDocumentError)
The owned XML document boundary rejected an identity or mutation.
MissingRequired(&'static str)
Required child element or attribute was absent.
InvalidStructure(String)
The XML element order or namespace is invalid for the XMLEnc profile.
The selected operation-start node ID is absent or resolves ambiguously.
UnsupportedAlgorithm(String)
An algorithm URI is not supported by this build.
Base64(String)
Base64 input is invalid or exceeds the configured input bound.
DataTooShort
A decoded cipher value is too short for its algorithm’s framing.
Fields
InvalidCbcCiphertextLength(usize)
CBC ciphertext is not a non-empty multiple of the AES block size.
InvalidPadding
XMLEnc random padding is invalid.
No decrypted padding details are exposed. This does not authenticate CBC ciphertexts or make success/failure safe to expose to an attacker.
AeadAuthenticationFailed
GCM authentication failed.
InvalidKeySize
A supplied content key is not the expected size.
Fields
algorithm: DataEncryptionAlgorithmContent algorithm requiring the key.
AmbiguousKeyCandidates
An unauthenticated content algorithm cannot safely select among keys.
Fields
algorithm: DataEncryptionAlgorithmUnauthenticated algorithm for which key success is ambiguous.
InvalidKekSize
A supplied AES key-encryption key is not the size declared by EncryptedKey.
Fields
algorithm: KeyWrapAlgorithmKey-wrap algorithm requiring the KEK.
InvalidWrappedKeyLength
A wrapped-key input or provider output has invalid algorithm framing.
Fields
InvalidEncryptionConfig(String)
Encryption configuration is internally inconsistent.
KeyNotFound
No caller-provided resolver could supply a usable key.
EncryptedDataNotFound
No EncryptedData matched the requested document selection.
AmbiguousEncryptedData
More than one EncryptedData matched the requested document selection.
EncryptionTargetNotFound
No source element matched the requested encryption target.
AmbiguousEncryptionTarget
More than one source element matched the requested encryption target.
ReplacementRequiresXml
Document replacement requires an XML Type declaration.
Rsa(String)
RSA-OAEP session-key recovery failed.
RsaEncrypt(String)
RSA-OAEP session-key wrapping failed.
KeyWrapIntegrity
RFC 3394 integrity validation failed while unwrapping a key.
Rng(String)
Operating-system randomness was unavailable.
XmlSerialize(String)
Generated XML could not be serialized.
Utf8(FromUtf8Error)
XML-declared plaintext could not be decoded as UTF-8.
Trait Implementations§
Source§impl Debug for XmlEncError
impl Debug for XmlEncError
Source§impl Display for XmlEncError
impl Display for XmlEncError
Source§impl Error for XmlEncError
impl Error for XmlEncError
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()