pub struct DecryptContext<'a> { /* private fields */ }Expand description
Immutable XMLEnc decryption operation context.
Implementations§
Source§impl<'a> DecryptContext<'a>
impl<'a> DecryptContext<'a>
Sourcepub fn new(resolver: &'a dyn DecryptionKeyResolver) -> Self
pub fn new(resolver: &'a dyn DecryptionKeyResolver) -> Self
Create a context with the default decryption policy and RustCrypto provider.
Sourcepub fn policy(self, policy: DecryptionPolicy) -> Self
pub fn policy(self, policy: DecryptionPolicy) -> Self
Replace the complete immutable decryption policy snapshot.
Sourcepub fn provider(self, provider: &'a dyn CryptoProvider) -> Self
pub fn provider(self, provider: &'a dyn CryptoProvider) -> Self
Select the cryptographic provider for this decryption operation.
Sourcepub fn id_attributes(self, registrations: &'a [IdAttributeRegistration]) -> Self
pub fn id_attributes(self, registrations: &'a [IdAttributeRegistration]) -> Self
Add caller-declared ID attributes for operation start-node lookup.
Sourcepub fn decrypt(&self, xml: &str) -> Result<DecryptedContent, XmlEncError>
pub fn decrypt(&self, xml: &str) -> Result<DecryptedContent, XmlEncError>
Parse and decrypt a standalone EncryptedData XML fragment.
Sourcepub fn decrypt_data(
&self,
encrypted: &EncryptedData,
) -> Result<DecryptedContent, XmlEncError>
pub fn decrypt_data( &self, encrypted: &EncryptedData, ) -> Result<DecryptedContent, XmlEncError>
Decrypt an already parsed EncryptedData value.
Sourcepub fn decrypt_document(
&self,
xml: &str,
encrypted_data_id: Option<&str>,
) -> Result<String, XmlEncError>
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.
Sourcepub fn decrypt_owned_document(
&self,
document: &mut XmlDocument,
encrypted_data_id: Option<&str>,
) -> Result<(), XmlEncError>
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.
Sourcepub fn decrypt_document_from_start_node(
&self,
xml: &str,
start_node_id: Option<&str>,
) -> Result<String, XmlEncError>
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.
Sourcepub fn decrypt_first_document_from_start_node(
&self,
xml: &str,
start_node_id: Option<&str>,
) -> Result<String, XmlEncError>
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.