Expand description
SEA (Security, Encryption, Authorization) module Based on Gun.js sea/ directory Provides encryption, authentication, and authorization capabilities
Re-exports§
pub use secret::secret_sync;pub use user::accept_grant;pub use user::verify_trust;
Modules§
- certify
- SEA.certify — capability certificates for delegated authorization
- decrypt
- AES-GCM decryption Reverse of encrypt.rs
- encrypt
- AES-GCM encryption Based on Gun.js sea/encrypt.js Uses ECDH-derived key + SHA-256 + AES-256-GCM Matches Gun.js aeskey.js semantics: SHA-256(key_string + salt_bytes)
- pair
- Key pair generation — Gun.js
sea/pair.jsequivalent. - secret
- ECDH shared secret derivation Based on Gun.js sea/secret.js Derives a shared secret from ECDH key exchange
- session
- Session storage backends for SEA
recall(). - sign
- Digital signatures — Gun.js
sea/sign.jsequivalent. - user
- User authentication and session management Provides create/auth/leave/recall using BEAM’s graph persistence
- verify
- Signature verification — Gun.js
sea/verify.jsequivalent. - work
- Proof of Work and content hashing — Gun.js
sea/work.jsequivalent.
Structs§
- Identity
- Identity metadata for an authenticated user.
Mirrors Gun.js
user.issemantics. - KeyPair
- Key pair for signing and encryption
- Session
State - Session state behind
Arc<RwLock>for shared invalidation across clones - User
- Authenticated user with shared session state Clones share the same underlying session — leave() invalidates all holders.
- Work
Options - Options for SEA.work()
Enums§
- SeaError
- SEA module error types
Traits§
- Session
Storage - Session storage trait for recall() persistence — async by default
Functions§
- certify
- Build and sign a capability certificate authorizing certificants.
- decrypt
- Decrypt data using AES-GCM
- decrypt_
symmetric - Decrypt data using a raw 32-byte AES-256 key.
- encrypt
- Encrypt data using AES-GCM
- encrypt_
symmetric - Encrypt data using a raw 32-byte AES-256 key.
- generate_
pair - Generate a new key pair for signing and encryption
- is_
pubkey_ certified - Check if a pubkey appears in certificate’s certificants list.
- secret
- Derive shared secret from ECDH key exchange
- sign
- Sign data with a key pair
- sign_
value - Sign JSON data and wrap as a BEAM Value::Text for user-space puts. The returned value is a JSON-serialized {“m”: message, “s”: signature} string. Call this before db.put(value) when writing authenticated user data.
- verify
- Verify a signature (async wrapper for backwards compat)
- verify_
async - Verify a signature asynchronously (non-blocking wrapper via spawn_blocking) Preferred for new code that must not block the async executor.
- verify_
certificate - Verify a signed certificate against authority pubkey (sync).
- verify_
sync - Verify a signature synchronously (for use from message.rs)
- work
- Compute proof-of-work or content hash