Expand description
§SZ-ORM Crypto — 加密工具
提供常用密码学原语:AES-256-GCM 对称加密、HMAC-SHA256 消息认证码、 PBKDF2 密钥派生与 SHA-256 哈希,所有实现基于 RustCrypto,保证常数时间比较。
§主要函数
sha256/sha256_hex— SHA-256 哈希- AES-256-GCM 加解密
- HMAC-SHA256 与 PBKDF2
Modules§
- key_
management - 密钥管理:密钥生成、轮换、存储、检索与版本管理
Structs§
- AesGcm
Crypter - AES-256-GCM crypter (cryptographically secure).
- Hmac
Signature Verifier - HMAC-SHA256 signature verifier.
- Hmac
Signer - HMAC-SHA256 API signer.
- KeyManager
- Key manager (supports rotation).
- KeyRotation
Manager - Key rotation manager.
- Pbkdf2
Hasher - PBKDF2-HMAC-SHA256 password hasher (based on RustCrypto pbkdf2 crate).
- RsaOaep
Crypter - RSA-OAEP asymmetric crypter (based on RustCrypto
rsacrate). - Versioned
Key - Versioned key.
Enums§
Traits§
- ApiSigner
- Crypter
- Password
Hasher - Signature
Verifier - Signature verifier trait: provides message signing and verification interfaces.
Functions§
- hmac_
sha256 - HMAC-SHA256 (RFC 2104, based on RustCrypto hmac crate).
- hmac_
sha256_ hex - HMAC-SHA256 hexadecimal string.
- sha256
- Compute the SHA-256 hash (based on RustCrypto sha2).
- sha256_
hex - Compute SHA-256 and return the result as a hexadecimal string.