pub struct PubSecCfGroup {
pub name: String,
pub p: i32,
pub recipients: Vec<PubSecRecipient>,
pub seed: [u8; 20],
pub cek: Vec<u8>,
pub envelope_iv: [u8; 16],
}Expand description
One permission-set inside a public-key-encrypted PDF. Each group
emits one PKCS#7 EnvelopedData whose plaintext carries the
supplied permission mask p; only the recipients listed here can
open with those permissions.
Per ISO 32000-1 §7.6.4.2 + §7.6.5.4: “There shall be one PKCS#7
object per unique set of access permissions; if a recipient appears
in more than one list, the permissions used shall be those in the
first matching list.” The file encryption key is derived from
SHA(seed_of_matched_envelope ‖ all_envelope_blobs_in_array_order)
— every envelope in the /Recipients array contributes to the
hash regardless of which one matched, so all recipients share the
same per-object encryption key while seeing different permissions.
The round-12 multi-CF encoder ALSO supports separate
[PubSecMultiCfConfig::cf_groups] when the caller wants the
/CF dict to enumerate distinct CRYPT FILTERS (each with its
own list); see PubSecMultiCfConfig for the shape.
Fields§
§name: StringName under /CF — typically a descriptive label like
OwnerCryptFilter or ReadOnlyCryptFilter. Must match the
dictionary-key ASCII alphabet (no / prefix; the encoder adds
it).
p: i32Permission mask for this group (4-byte signed integer per ISO 32000-1 §7.6.3.2 Table 22).
recipients: Vec<PubSecRecipient>Recipients allowed to open with this permission set. The same recipient may appear in multiple groups; the round-12 reader’s first-CF-match rule applies (the group order is the order supplied here, with the StmF entry sorted to the front).
seed: [u8; 20]Per-group seed (round-trips deterministically; production callers should override with fresh random per group).
cek: Vec<u8>Per-group content-encryption key. Length must match the parent config’s SubFilter (16 / 32 bytes).
envelope_iv: [u8; 16]Per-group AES-CBC envelope IV (s5 only).
Implementations§
Source§impl PubSecCfGroup
impl PubSecCfGroup
Sourcepub fn full_access_aes256(
name: impl Into<String>,
recipients: Vec<PubSecRecipient>,
) -> Self
pub fn full_access_aes256( name: impl Into<String>, recipients: Vec<PubSecRecipient>, ) -> Self
Convenience constructor: full access (p = -4) for AES-256.
Sourcepub fn read_only_aes256(
name: impl Into<String>,
recipients: Vec<PubSecRecipient>,
) -> Self
pub fn read_only_aes256( name: impl Into<String>, recipients: Vec<PubSecRecipient>, ) -> Self
Convenience constructor: read-only (p clears the print + modify
- extract bits per Table 22). The mask
0xFFFF_F0BFcorresponds to “view + accessibility-extract only”.
Trait Implementations§
Source§impl Clone for PubSecCfGroup
impl Clone for PubSecCfGroup
Source§fn clone(&self) -> PubSecCfGroup
fn clone(&self) -> PubSecCfGroup
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more