Module webcrypto

Module webcrypto 

Source
Expand description

WebCrypto API Compatibility Layer

This module provides compatibility with the W3C WebCrypto API standard, enabling interoperability between Rust cryptographic operations and browser-based WebCrypto operations.

§Examples

use chie_crypto::webcrypto::{WebCryptoKey, Algorithm, KeyUsage};
use chie_crypto::signing::KeyPair;

// Create a WebCrypto-compatible key
let keypair = KeyPair::generate();
let web_key = WebCryptoKey::from_ed25519_keypair(&keypair, &[KeyUsage::Sign]);

// Export to JWK (WebCrypto standard format)
let jwk = web_key.to_jwk().unwrap();

Structs§

WebCryptoKey
WebCrypto-compatible key
WebCryptoKeyPair
WebCrypto key pair (for asymmetric algorithms)

Enums§

Algorithm
WebCrypto algorithm identifiers
KeyType
WebCrypto key type
KeyUsage
WebCrypto key usage flags
WebCryptoError
WebCrypto API errors

Type Aliases§

WebCryptoResult
Result type for WebCrypto operations