pub struct AsymmetricAlgorithmBuilder;
Expand description
Builder for constructing asymmetric algorithm instances.
用于构建非对称算法实例的构建器。
§Design Pattern | 设计模式
This builder follows a fluent interface pattern, allowing method chaining to construct the desired algorithm configuration. Each method returns a specialized builder for that algorithm category.
此构建器遵循流畅接口模式,允许方法链接来构建所需的算法配置。 每个方法都返回该算法类别的专用构建器。
§Algorithm Selection Guide | 算法选择指南
-
KEM: For secure key establishment and hybrid encryption
-
Signatures: For authentication and non-repudiation
-
Key Agreement: For establishing shared secrets
-
KEM: 用于安全密钥建立和混合加密
-
签名: 用于认证和不可否认性
-
密钥协商: 用于建立共享密钥
Implementations§
Source§impl AsymmetricAlgorithmBuilder
impl AsymmetricAlgorithmBuilder
Sourcepub fn kem(self) -> KemAlgorithmBuilder
pub fn kem(self) -> KemAlgorithmBuilder
Creates a KEM (Key Encapsulation Mechanism) algorithm builder.
创建 KEM(密钥封装机制)算法构建器。
§Use Cases | 使用场景
-
Hybrid encryption schemes
-
Secure key establishment
-
Post-quantum secure communications
-
混合加密方案
-
安全密钥建立
-
后量子安全通信
§Available Algorithms | 可用算法
- RSA: Traditional, widely supported
- Kyber: Post-quantum, NIST standardized
§Examples | 示例
use seal_crypto_wrapper::algorithms::asymmetric::AsymmetricAlgorithm;
let kyber = AsymmetricAlgorithm::build().kem().kyber768();
let rsa = AsymmetricAlgorithm::build().kem().rsa2048().sha256();
Sourcepub fn signature(self) -> SignatureAlgorithmBuilder
pub fn signature(self) -> SignatureAlgorithmBuilder
Creates a digital signature algorithm builder.
创建数字签名算法构建器。
§Use Cases | 使用场景
-
Document signing and verification
-
Authentication protocols
-
Software integrity verification
-
Blockchain and cryptocurrency
-
文档签名和验证
-
认证协议
-
软件完整性验证
-
区块链和加密货币
§Available Algorithms | 可用算法
- Ed25519: High performance, modern
- ECDSA P-256: NIST standard, widely supported
- Dilithium: Post-quantum, NIST standardized
§Examples | 示例
use seal_crypto_wrapper::algorithms::asymmetric::AsymmetricAlgorithm;
let ed25519 = AsymmetricAlgorithm::build().signature().ed25519();
let dilithium = AsymmetricAlgorithm::build().signature().dilithium2();
Sourcepub fn key_agreement(self) -> KeyAgreementAlgorithmBuilder
pub fn key_agreement(self) -> KeyAgreementAlgorithmBuilder
Creates a key agreement algorithm builder.
创建密钥协商算法构建器。
§Use Cases | 使用场景
-
Establishing shared secrets
-
Secure channel establishment
-
Forward secrecy protocols
-
建立共享密钥
-
安全通道建立
-
前向保密协议
§Available Algorithms | 可用算法
- ECDH P-256: Elliptic Curve Diffie-Hellman
§Examples | 示例
use seal_crypto_wrapper::algorithms::asymmetric::AsymmetricAlgorithm;
let ecdh = AsymmetricAlgorithm::build().key_agreement().ecdh_p256();