Skip to main content

Module manager

Module manager 

Source
Expand description

门面(Manager):注册表 + 默认标识的组合,业务层的常用入口。

对应 PHP 版的 EncryptionManager、AsymmetricCryptoManager、HashingManager、 KeyDerivationManager、PasswordBasedKdfManager。每个门面提供「用默认算法」与 「显式指定 *_with(identifier, ...)」两组方法。

八个门面(本文件的六个 + asymmetric 子模块的两个)结构完全同构:都是 Registry<Box<dyn 能力>> 加一个默认标识,默认方法一律转发给 *_with。 因此它们统一由 manager_facade! 宏生成——调用点只声明门面名、能力 trait、 错误消息里的能力名,以及一张「默认方法 → *_with 方法」的转发表; 加一个门面是加一段声明,不是把几十行样板再抄一遍。

Structs§

AsymmetricCryptoManager
非对称加密门面。
EncryptionManager
对称加密门面。
HashingManager
哈希门面。
KeyAgreementManager
密钥协商门面。
KeyDerivationManager
密钥派生(HKDF)门面。
KeyEncapsulationManager
密钥封装(KEM)门面。
PasswordBasedKdfManager
口令派生(PBKDF2)门面。
SignatureManager
签名门面。