Module rings_core::session

source ·
Expand description

Signing/verifying and encrypting/decrypting messages.

This module provides a mechanism for node A to verify that the message received was sent by node B. It also allows node A to obtain the public key for sending encrypted messages to node B.

Considering security factors, asking user to provide private key is not practical. On the contrary, we generate a delegated private key and let user sign it.

See SessionManager and SessionManagerBuilder for details.

Structs

  • Session is used to verify the message. It’s serializable and can be attached to the message payload.
  • SessionManager holds the Session and its delegated private key. To prove that the message was sent by the Authorizer of Session, we need to attach session and the signature signed by session_key to the payload.
  • SessionManagerBuilder is used to build a SessionManager.

Enums

  • We will support as many protocols/algorithms as possible. Currently, it comprises Secp256k1, EIP191, BIP137, and Ed25519. We welcome any issues and PRs for additional implementations.