pub struct ModifyProtection {
pub salt_b64: String,
pub hash_b64: String,
pub spin_count: u32,
pub crypt_provider_type: &'static str,
pub algorithm_sid: u32,
}Expand description
修改密码保护参数。
对应 <p:modifyVerifier> XML 元素,包含密码哈希、salt、迭代次数等。
注入到 presentation.xml 后,WPS / PowerPoint 打开时会提示
“以只读方式打开“或“输入密码以修改”。
Fields§
§salt_b64: Stringsalt 的 base64 编码。
hash_b64: String哈希值的 base64 编码。
spin_count: u32迭代次数。
crypt_provider_type: &'static str加密算法提供者类型。
algorithm_sid: u32加密算法 SID(14 = SHA-512)。
Implementations§
Source§impl ModifyProtection
impl ModifyProtection
Sourcepub fn from_password(password: &str, salt: &[u8], spin_count: u32) -> Self
pub fn from_password(password: &str, salt: &[u8], spin_count: u32) -> Self
Sourcepub fn verify_password(&self, password: &str) -> bool
pub fn verify_password(&self, password: &str) -> bool
验证密码是否匹配。
用相同算法重新计算哈希,与存储的哈希比对。
Sourcepub fn to_xml_element(&self) -> String
pub fn to_xml_element(&self) -> String
序列化为 <p:modifyVerifier .../> XML 元素。
元素位置必须在 <p:extLst> 之前(OOXML schema 顺序要求)。
Trait Implementations§
Source§impl Clone for ModifyProtection
impl Clone for ModifyProtection
Source§fn clone(&self) -> ModifyProtection
fn clone(&self) -> ModifyProtection
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 ModifyProtection
impl RefUnwindSafe for ModifyProtection
impl Send for ModifyProtection
impl Sync for ModifyProtection
impl Unpin for ModifyProtection
impl UnsafeUnpin for ModifyProtection
impl UnwindSafe for ModifyProtection
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