pub enum EncryptionVersion<'a> {
V1 {
document: &'a Document,
owner_password: &'a str,
user_password: &'a str,
permissions: Permissions,
},
V2 {
document: &'a Document,
owner_password: &'a str,
user_password: &'a str,
key_length: usize,
permissions: Permissions,
},
V4 {
document: &'a Document,
encrypt_metadata: bool,
crypt_filters: BTreeMap<Vec<u8>, Arc<dyn CryptFilter>>,
stream_filter: Vec<u8>,
string_filter: Vec<u8>,
owner_password: &'a str,
user_password: &'a str,
permissions: Permissions,
},
R5 {
encrypt_metadata: bool,
crypt_filters: BTreeMap<Vec<u8>, Arc<dyn CryptFilter>>,
file_encryption_key: &'a [u8],
stream_filter: Vec<u8>,
string_filter: Vec<u8>,
owner_password: &'a str,
user_password: &'a str,
permissions: Permissions,
},
V5 {
encrypt_metadata: bool,
crypt_filters: BTreeMap<Vec<u8>, Arc<dyn CryptFilter>>,
file_encryption_key: &'a [u8],
stream_filter: Vec<u8>,
string_filter: Vec<u8>,
owner_password: &'a str,
user_password: &'a str,
permissions: Permissions,
},
}
Variants§
V1
(PDF 1.4; deprecated in PDF 2.0) Indicates the use of encryption of data using the RC4 or AES algorithms with a file encryption key length of 40 bits.
Fields
permissions: Permissions
V2
(PDF 1.4; deprecated in PDF 2.0) Indicates the use of encryption of data using the RC4 or AES algorithms but permitting file encryption key lengths greater or 40 bits.
Fields
permissions: Permissions
V4
(PDF 1.5; deprecated in PDF 2.0) The security handler defines the use of encryption and decryption in the document, using the rules specified by the CF, StmF and StrF entries using encryption of data using the RC4 or AES algorithms (deprecated in PDF 2.0) with a file encryption key length of 128 bits.
Fields
permissions: Permissions
R5
(PDF 2.0; deprecated in PDF 2.0) Shall not be used. This value was used by a deprecated proprietary Adobe extension.
This exists for testing purposes to guarantee improved compatibility.
Fields
encrypt_metadata: bool
crypt_filters: BTreeMap<Vec<u8>, Arc<dyn CryptFilter>>
file_encryption_key: &'a [u8]
stream_filter: Vec<u8>
string_filter: Vec<u8>
owner_password: &'a str
user_password: &'a str
permissions: Permissions
V5
(PDF 2.0) The security handler defines the use of encryption and decryption in the document, using the rules specified by the CF, StmF, StrF and EFF entries using encryption of data using the AES algorithms with a file encryption key length of 256 bits.
Trait Implementations§
Source§impl<'a> Clone for EncryptionVersion<'a>
impl<'a> Clone for EncryptionVersion<'a>
Source§fn clone(&self) -> EncryptionVersion<'a>
fn clone(&self) -> EncryptionVersion<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more