pub struct KeyEntry {
pub metadata: KeyMetadata,
pub material: Vec<u8>,
pub fingerprint: String,
}Expand description
密钥条目,包含元数据与密钥材料
Fields§
§metadata: KeyMetadata密钥元数据
material: Vec<u8>密钥材料(字节)
fingerprint: String密钥指纹(SHA-256 十六进制,用于无泄露标识)
Implementations§
Source§impl KeyEntry
impl KeyEntry
Sourcepub fn compute_fingerprint(material: &[u8]) -> String
pub fn compute_fingerprint(material: &[u8]) -> String
计算密钥材料的 SHA-256 指纹(十六进制)
Sourcepub fn verify_fingerprint(&self) -> bool
pub fn verify_fingerprint(&self) -> bool
验证密钥材料与指纹是否匹配
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyEntry
impl RefUnwindSafe for KeyEntry
impl Send for KeyEntry
impl Sync for KeyEntry
impl Unpin for KeyEntry
impl UnsafeUnpin for KeyEntry
impl UnwindSafe for KeyEntry
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