Skip to main content

XmlEncError

Enum XmlEncError 

Source
#[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
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.
§

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.

§

SelectedNodeUnavailable

The selected operation-start node ID is absent or resolves ambiguously.

Fields

§id: String

Caller-supplied node identifier.

§

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

§algorithm: &'static str

Algorithm name.

§minimum: usize

Minimum valid byte length.

§actual: usize

Actual byte length.

§

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: DataEncryptionAlgorithm

Content algorithm requiring the key.

§expected: usize

Expected key size.

§actual: usize

Actual key size.

§

AmbiguousKeyCandidates

An unauthenticated content algorithm cannot safely select among keys.

Fields

§algorithm: DataEncryptionAlgorithm

Unauthenticated algorithm for which key success is ambiguous.

§actual: usize

Number of unresolved candidate keys.

§

InvalidKekSize

A supplied AES key-encryption key is not the size declared by EncryptedKey.

Fields

§algorithm: KeyWrapAlgorithm

Key-wrap algorithm requiring the KEK.

§expected: usize

Expected KEK size.

§actual: usize

Actual KEK size.

§

InvalidWrappedKeyLength

A wrapped-key input or provider output has invalid algorithm framing.

Fields

§expected: usize

Exact wrapped length required by the algorithm and key context.

§actual: usize

Actual input or provider output length.

§

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

Source§

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

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

impl Display for XmlEncError

Source§

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

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

impl Error for XmlEncError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for XmlEncError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for XmlEncError

Source§

fn from(source: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl From<PolicyViolation> for XmlEncError

Source§

fn from(source: PolicyViolation) -> Self

Converts to this type from the input type.
Source§

impl From<ProviderError> for XmlEncError

Source§

fn from(source: ProviderError) -> Self

Converts to this type from the input type.
Source§

impl From<XmlDocumentError> for XmlEncError

Source§

fn from(source: XmlDocumentError) -> Self

Converts to this type from the input type.

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> AsErrorSource for T
where T: Error + 'static,

Source§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method receivers.
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Same for T

Source§

type Output = T

Should always be Self
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, <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.