pub struct EncryptionState {
pub handler: StandardHandler,
pub encrypt_dict: Dict,
pub file_id: Vec<u8>,
pub aes_iv: [u8; 16],
}Expand description
Resolved writer-side state — handler (file key + crypt method),
the /Encrypt dictionary, and the /ID array. Built once at the
start of crate::objects::Document::write_to and threaded
through per-object string + stream encryption.
Fields§
§handler: StandardHandlerHandler used to encrypt every string + stream.
encrypt_dict: Dict/Encrypt dictionary as it must appear in the file. Becomes a
new indirect object at write time.
file_id: Vec<u8>16-byte file ID — placed in trailer /ID[0] AND /ID[1].
aes_iv: [u8; 16]IV used for per-object AES encryption. Tests pin; the writer uses one IV across all objects when this is the only knob (the per-object Algorithm 1 key derivation already varies the effective key per object).
Implementations§
Source§impl EncryptionState
impl EncryptionState
Sourcepub fn build(config: &EncryptionConfig) -> Result<Self, PdfError>
pub fn build(config: &EncryptionConfig) -> Result<Self, PdfError>
Build the writer-side state from a config.
Trait Implementations§
Source§impl Clone for EncryptionState
impl Clone for EncryptionState
Source§fn clone(&self) -> EncryptionState
fn clone(&self) -> EncryptionState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EncryptionState
impl RefUnwindSafe for EncryptionState
impl Send for EncryptionState
impl Sync for EncryptionState
impl Unpin for EncryptionState
impl UnsafeUnpin for EncryptionState
impl UnwindSafe for EncryptionState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more