pub enum KeyAlgorithm {
Aes256Gcm,
HmacSha256,
Rsa2048,
Rsa4096,
}Expand description
密钥算法类型
Variants§
Aes256Gcm
AES-256-GCM 对称加密密钥(32 字节)
HmacSha256
HMAC-SHA256 签名密钥(32 字节)
Rsa2048
RSA 2048 位非对称密钥(256 字节私钥材料占位)
Rsa4096
RSA 4096 位非对称密钥(512 字节私钥材料占位)
Implementations§
Source§impl KeyAlgorithm
impl KeyAlgorithm
Sourcepub fn key_length(&self) -> usize
pub fn key_length(&self) -> usize
返回密钥材料的字节长度
Sourcepub fn is_symmetric(&self) -> bool
pub fn is_symmetric(&self) -> bool
是否为对称算法
Trait Implementations§
Source§impl Clone for KeyAlgorithm
impl Clone for KeyAlgorithm
Source§fn clone(&self) -> KeyAlgorithm
fn clone(&self) -> KeyAlgorithm
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 moreimpl Copy for KeyAlgorithm
Source§impl Debug for KeyAlgorithm
impl Debug for KeyAlgorithm
Source§impl<'de> Deserialize<'de> for KeyAlgorithm
impl<'de> Deserialize<'de> for KeyAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for KeyAlgorithm
impl Display for KeyAlgorithm
impl Eq for KeyAlgorithm
Source§impl Hash for KeyAlgorithm
impl Hash for KeyAlgorithm
Source§impl PartialEq for KeyAlgorithm
impl PartialEq for KeyAlgorithm
Source§impl Serialize for KeyAlgorithm
impl Serialize for KeyAlgorithm
impl StructuralPartialEq for KeyAlgorithm
Auto Trait Implementations§
impl Freeze for KeyAlgorithm
impl RefUnwindSafe for KeyAlgorithm
impl Send for KeyAlgorithm
impl Sync for KeyAlgorithm
impl Unpin for KeyAlgorithm
impl UnsafeUnpin for KeyAlgorithm
impl UnwindSafe for KeyAlgorithm
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