pub struct PublicKeySecurityHandler {
pub subfilter: SubFilter,
pub recipients: Vec<Recipient>,
pub seed_length: usize,
pub method: CryptFilterMethod,
}Expand description
Public Key Security Handler
Fields§
§subfilter: SubFilterSubFilter type
recipients: Vec<Recipient>Recipients list
seed_length: usizeSeed value length in bytes (20 for SHA-1, 32 for SHA-256)
method: CryptFilterMethodEncryption method
Implementations§
Source§impl PublicKeySecurityHandler
impl PublicKeySecurityHandler
Sourcepub fn new_sha256() -> Self
pub fn new_sha256() -> Self
Create a new public key security handler with SHA-256
Sourcepub fn add_recipient(
&mut self,
certificate: Vec<u8>,
permissions: Permissions,
) -> Result<()>
pub fn add_recipient( &mut self, certificate: Vec<u8>, permissions: Permissions, ) -> Result<()>
Add a recipient
Sourcepub fn decrypt_seed(
&self,
encrypted_seed: &[u8],
private_key: &[u8],
) -> Result<Vec<u8>>
pub fn decrypt_seed( &self, encrypted_seed: &[u8], private_key: &[u8], ) -> Result<Vec<u8>>
Decrypt seed value using private key
Sourcepub fn build_recipients_dict(&self) -> Dictionary
pub fn build_recipients_dict(&self) -> Dictionary
Build recipients dictionary for PDF
Sourcepub fn verify_permission(
&self,
recipient_index: usize,
permission: Permissions,
) -> bool
pub fn verify_permission( &self, recipient_index: usize, permission: Permissions, ) -> bool
Verify recipient has permission
Trait Implementations§
Source§impl SecurityHandler for PublicKeySecurityHandler
impl SecurityHandler for PublicKeySecurityHandler
Source§fn encrypt_string(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn encrypt_string( &self, data: &[u8], encryption_key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Encrypt string
Source§fn decrypt_string(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn decrypt_string( &self, data: &[u8], encryption_key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Decrypt string
Source§fn encrypt_stream(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn encrypt_stream( &self, data: &[u8], encryption_key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Encrypt stream
Source§fn decrypt_stream(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
obj_id: &ObjectId,
) -> Result<Vec<u8>>
fn decrypt_stream( &self, data: &[u8], encryption_key: &EncryptionKey, obj_id: &ObjectId, ) -> Result<Vec<u8>>
Decrypt stream
Source§fn encrypt_string_aes(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
_obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn encrypt_string_aes( &self, data: &[u8], encryption_key: &EncryptionKey, _obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Encrypt string with AES
Source§fn decrypt_string_aes(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
_obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn decrypt_string_aes( &self, data: &[u8], encryption_key: &EncryptionKey, _obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Decrypt string with AES
Source§fn encrypt_stream_aes(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn encrypt_stream_aes( &self, data: &[u8], encryption_key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Encrypt stream with AES
Source§fn decrypt_stream_aes(
&self,
data: &[u8],
encryption_key: &EncryptionKey,
obj_id: &ObjectId,
bits: u32,
) -> Result<Vec<u8>>
fn decrypt_stream_aes( &self, data: &[u8], encryption_key: &EncryptionKey, obj_id: &ObjectId, bits: u32, ) -> Result<Vec<u8>>
Decrypt stream with AES
Auto Trait Implementations§
impl Freeze for PublicKeySecurityHandler
impl RefUnwindSafe for PublicKeySecurityHandler
impl Send for PublicKeySecurityHandler
impl Sync for PublicKeySecurityHandler
impl Unpin for PublicKeySecurityHandler
impl UnwindSafe for PublicKeySecurityHandler
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