Skip to main content

DecryptContext

Struct DecryptContext 

Source
pub struct DecryptContext<'a> { /* private fields */ }
Expand description

Immutable XMLEnc decryption operation context.

Implementations§

Source§

impl<'a> DecryptContext<'a>

Source

pub fn new(resolver: &'a dyn DecryptionKeyResolver) -> Self

Create a context with the default decryption policy and RustCrypto provider.

Source

pub fn policy(self, policy: DecryptionPolicy) -> Self

Replace the complete immutable decryption policy snapshot.

Source

pub fn provider(self, provider: &'a dyn CryptoProvider) -> Self

Select the cryptographic provider for this decryption operation.

Source

pub fn id_attributes(self, registrations: &'a [IdAttributeRegistration]) -> Self

Add caller-declared ID attributes for operation start-node lookup.

Source

pub fn decrypt(&self, xml: &str) -> Result<DecryptedContent, XmlEncError>

Parse and decrypt a standalone EncryptedData XML fragment.

Source

pub fn decrypt_data( &self, encrypted: &EncryptedData, ) -> Result<DecryptedContent, XmlEncError>

Decrypt an already parsed EncryptedData value.

Source

pub fn decrypt_document( &self, xml: &str, encrypted_data_id: Option<&str>, ) -> Result<String, XmlEncError>

Decrypt and replace one selected EncryptedData in a caller-owned document.

Source

pub fn decrypt_owned_document( &self, document: &mut XmlDocument, encrypted_data_id: Option<&str>, ) -> Result<(), XmlEncError>

Decrypt and replace one selected EncryptedData in an owned document.

Source

pub fn decrypt_document_from_start_node( &self, xml: &str, start_node_id: Option<&str>, ) -> Result<String, XmlEncError>

Decrypt and replace the sole EncryptedData below an operation start node selected by ID.

Source

pub fn decrypt_first_document_from_start_node( &self, xml: &str, start_node_id: Option<&str>, ) -> Result<String, XmlEncError>

Decrypt and replace the first EncryptedData below an operation start node selected by ID, leaving later encrypted descendants untouched.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for DecryptContext<'a>

§

impl<'a> !Send for DecryptContext<'a>

§

impl<'a> !Sync for DecryptContext<'a>

§

impl<'a> !UnwindSafe for DecryptContext<'a>

§

impl<'a> Freeze for DecryptContext<'a>

§

impl<'a> Unpin for DecryptContext<'a>

§

impl<'a> UnsafeUnpin for DecryptContext<'a>

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<'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, 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.