Struct AsymmetricAlgorithmBuilder

Source
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

Source

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();
Source

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();
Source

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();

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V