Aranya Documentation An overview of the Aranya project

Aranya Rust API

Aranya provides Rust APIs to interact with the Aranya Client and Daemon. The Rust Client library is used as an interface to the Daemon, the Aranya Daemon maintains the state of Aranya and syncs with peers.

Aranya Client

Aranya’s Rust Client is the library that your application will interface with. By integrating the library into an application, IDAM/RBAC and secure data transmission can be easily added without needing to develop complex security architectures, protocols, and cryptography.

The client provides the following functionality:

  • Add and remove sync peers. The daemon will periodically attempt to sync Aranya state with any peers (as long as it is able to communicate with the peer over the network) in its configured sync peer list.
  • Add and remove devices from the team as determined by the implemented policy.
  • Assign and revoke device roles as determined by the implemented policy.
  • Create, delete, assign and revoke labels used for attribute based controls and segmentation of data communicated between peers within Aranya Fast Channels as determined by the implemented policy.
  • Create and delete Fast Channels channels as determined by the implemented policy.
  • Send and receive encrypted data using Aranya Fast Channels. Fast Channels supports bidirectional encrypted data exchange over TCP transport. Note: The functionality noted ‘as determined by the implemented policy’ are defined in the default policy. As such, these may differ depending on the policy implemented in your application.

Aranya Daemon

The Aranya Daemon is a long-running executable that is used to maintain the state of Aranya after adding commands to the graph or syncing commands from other peers by interacting directly with the Aranya Core library. See here for details on the Aranya functionality available through the daemon.

The daemon’s responsibilities include:

  • Periodically syncing state between networked Aranya peers to ensure they all have consistent state. This includes the ability to add and remove sync peers, available to your application through the Rust Client library.
  • Invokes actions received from the client and handles effects from the Aranya Core library. See the walkthrough for more details.
  • Generates and maintains cryptographic keys for encrypting and decrypting data for Aranya and Fast Channels.

Rust API docs

Rust example

There is a Rust example application that runs a cargo-generate template to give a quick way to get up and running. During setup, the example application starts an instance of the aranya-daemon for multiple Aranya devices in the background. The daemon automatically handles syncing the Aranya graph states between peers so the Aranya client can focus on the operations it wants to perform on the team.

The example app shows how to use the aranya-client library to:

  • Setup a team
  • Sync Aranya graphs
  • Create an Aranya Fast Channel
  • Send encrypted data between peers