pub struct PubSecEncryptionState {
pub handler: StandardHandler,
pub encrypt_dict: Dict,
pub aes_iv: [u8; 16],
pub file_id: Vec<u8>,
}Expand description
Result of building the writer-side public-key state — symmetric to
the password-based crate::encrypt::EncryptionState. Callers
install the handler / encrypt_dict on a Document exactly as the
password-based encoder does.
Fields§
§handler: StandardHandlerFile encryption handler (key + per-object method + revision).
encrypt_dict: Dict/Encrypt dictionary literal to thread into the trailer.
aes_iv: [u8; 16]Per-object AES IV.
file_id: Vec<u8>Permanent file identifier — placed in /ID[0]. Public-key
PDFs still need an /ID array; we generate a deterministic
16-byte one (or accept a caller-supplied override via
crate::write_pdf_from_scene_pubsec_encrypted).
Implementations§
Source§impl PubSecEncryptionState
impl PubSecEncryptionState
Sourcepub fn into_encryption_state(self) -> EncryptionState
pub fn into_encryption_state(self) -> EncryptionState
Convert to the password-handler crate::encrypt::EncryptionState
shape so the writer can install it on Document::encryption
without duplicating the per-object encryption paths. The
resulting state’s encrypt_dict is /Filter /Adobe.PPKLite
(not /Filter /Standard) — every other slot is identical.
Sourcepub fn build(config: &PubSecEncoderConfig) -> Result<Self, PdfError>
pub fn build(config: &PubSecEncoderConfig) -> Result<Self, PdfError>
Build the writer-side state from a PubSecEncoderConfig. The
returned encrypt_dict is symmetric to what
super::open_with_certificate consumes.
Sourcepub fn with_file_id(self, file_id: Vec<u8>) -> Self
pub fn with_file_id(self, file_id: Vec<u8>) -> Self
Override the file ID (16+ bytes recommended).
Source§impl PubSecEncryptionState
impl PubSecEncryptionState
Sourcepub fn build_kari(config: &PubSecKariConfig) -> Result<Self, PdfError>
pub fn build_kari(config: &PubSecKariConfig) -> Result<Self, PdfError>
Round-15: build the writer-side state for a KARI-encrypted PDF.
Emits one CMS EnvelopedData containing one
KeyAgreeRecipientInfo per recipient (each one sized to its own
curve), all wrapping the same shared CEK with AES-256-WRAP.
Symmetric to the round-14 reader path: the resulting
/Encrypt dict opens via super::open_with_certificate when
the recipient passes a [PubSecCredential] carrying their EC
scalar.
Trait Implementations§
Source§impl Clone for PubSecEncryptionState
impl Clone for PubSecEncryptionState
Source§fn clone(&self) -> PubSecEncryptionState
fn clone(&self) -> PubSecEncryptionState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more