pub struct EncryptedDataBuilder { /* private fields */ }Expand description
Builder for complete EncryptedData fragments and document replacement.
Implementations§
Source§impl EncryptedDataBuilder
impl EncryptedDataBuilder
Sourcepub fn new(algorithm: DataEncryptionAlgorithm) -> Self
pub fn new(algorithm: DataEncryptionAlgorithm) -> Self
Create a builder for a content-encryption algorithm.
Sourcepub fn policy(self, policy: EncryptionPolicy) -> Self
pub fn policy(self, policy: EncryptionPolicy) -> Self
Replace the complete immutable encryption policy snapshot.
Sourcepub fn provider(self, provider: Arc<dyn CryptoProvider>) -> Self
pub fn provider(self, provider: Arc<dyn CryptoProvider>) -> Self
Select the cryptographic provider for this operation context.
Sourcepub fn encryption_type(self, encrypted_type: EncryptedDataType) -> Self
pub fn encryption_type(self, encrypted_type: EncryptedDataType) -> Self
Set whether XML encryption covers one element or its child content.
Sourcepub fn direct_key(self, key: impl Into<Vec<u8>>) -> Self
pub fn direct_key(self, key: impl Into<Vec<u8>>) -> Self
Use a caller-managed content key instead of generating and wrapping one.
Sourcepub fn direct_key_name(self, key_name: impl Into<String>) -> Self
pub fn direct_key_name(self, key_name: impl Into<String>) -> Self
Emit a direct KeyName hint for a caller-managed content key.
Sourcepub fn add_recipient(self, recipient: EncryptionRecipient) -> Self
pub fn add_recipient(self, recipient: EncryptionRecipient) -> Self
Add one independently wrapped recipient of the generated content key.
Sourcepub fn recipient_rsa_oaep(self, public_key: RsaPublicKey) -> Self
pub fn recipient_rsa_oaep(self, public_key: RsaPublicKey) -> Self
Add an RSA-OAEP recipient using secure XMLEnc 1.1 defaults.
Sourcepub fn recipient_key_transport(
self,
public_key: Arc<dyn KeyTransportKey>,
) -> Self
pub fn recipient_key_transport( self, public_key: Arc<dyn KeyTransportKey>, ) -> Self
Add an RSA-OAEP recipient backed by an opaque provider key handle.
Sourcepub fn recipient_aes_kw(
self,
kek: impl Into<Vec<u8>>,
algorithm: KeyWrapAlgorithm,
) -> Self
pub fn recipient_aes_kw( self, kek: impl Into<Vec<u8>>, algorithm: KeyWrapAlgorithm, ) -> Self
Add an AES Key Wrap recipient.
Sourcepub fn encrypt_xml(&self, xml: &str) -> Result<EncryptionResult, XmlEncError>
pub fn encrypt_xml(&self, xml: &str) -> Result<EncryptionResult, XmlEncError>
Encrypt one complete XML element or an XML content fragment.
Sourcepub fn encrypt_binary(
&self,
data: &[u8],
) -> Result<EncryptionResult, XmlEncError>
pub fn encrypt_binary( &self, data: &[u8], ) -> Result<EncryptionResult, XmlEncError>
Encrypt opaque bytes, preserving a configured non-XML Type hint.
Element and Content are XML replacement semantics and are omitted from binary output. Any other URI remains application metadata.
Sourcepub fn encrypt_document(
&self,
xml: &str,
options: DocumentEncryptionOptions<'_>,
) -> Result<String, XmlEncError>
pub fn encrypt_document( &self, xml: &str, options: DocumentEncryptionOptions<'_>, ) -> Result<String, XmlEncError>
Encrypt and replace the document root or one element selected by XML ID.
Sourcepub fn encrypt_owned_document(
&self,
document: &mut XmlDocument,
options: DocumentEncryptionOptions<'_>,
) -> Result<(), XmlEncError>
pub fn encrypt_owned_document( &self, document: &mut XmlDocument, options: DocumentEncryptionOptions<'_>, ) -> Result<(), XmlEncError>
Encrypt and replace a node in a reusable owned XML document.
Successful mutation advances the document generation and invalidates identities captured before this call.
Trait Implementations§
Source§impl Clone for EncryptedDataBuilder
impl Clone for EncryptedDataBuilder
Source§fn clone(&self) -> EncryptedDataBuilder
fn clone(&self) -> EncryptedDataBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more