Skip to main content

Crate sz_orm_crypto

Crate sz_orm_crypto 

Source
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§

AesGcmCrypter
AES-256-GCM crypter (cryptographically secure).
HmacSignatureVerifier
HMAC-SHA256 signature verifier.
HmacSigner
HMAC-SHA256 API signer.
KeyManager
Key manager (supports rotation).
KeyRotationManager
Key rotation manager.
Pbkdf2Hasher
PBKDF2-HMAC-SHA256 password hasher (based on RustCrypto pbkdf2 crate).
RsaOaepCrypter
RSA-OAEP asymmetric crypter (based on RustCrypto rsa crate).
VersionedKey
Versioned key.

Enums§

CryptoError

Traits§

ApiSigner
Crypter
PasswordHasher
SignatureVerifier
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.