| Crates.io | libkeri |
| lib.rs | libkeri |
| version | 0.1.0 |
| created_at | 2025-10-30 20:35:35.043471+00 |
| updated_at | 2025-10-30 20:35:35.043471+00 |
| description | A Rust library for KERI (Key Event Receipt Infrastructure) |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1908938 |
| size | 2,513,996 |
The Key Event Receipt Infrastructure (KERI) is a system designed to provide a secure identity basis using cryptographic key management, rotation and verification.
This repository contains a Rust implementation of KERI, designed to be used as a C-callable library. The implementation follows the KERI Protocol Specification.
KERI provides a secure foundation for decentralized identity management. Unlike traditional Public Key Infrastructure (PKI), which relies on centralized certificate authorities, KERI enables secure key rotation without the need for a central authority.
From a reliability engineering perspective, KERI solves key management problems in a portable, interoperable, and secure manner.
Features of this implementation:
git clone https://github.com/WebOfTrust/kerir.git
cd kerir
cargo build --release
[dependencies]
kerir = { git = "https://github.com/WebOfTrust/kerir.git" }
This implementation is designed as a C-callable library, allowing integration with applications written in C, C++, and other languages that support the C ABI. The library exposes a set of functions that can be called from C code to interact with KERI functionality.
#include "kerir.h"
int main() {
// Initialize KERI context
KERI_Context* ctx = keri_init();
// Generate a new identifier
const char* identifier = keri_generate_identifier(ctx);
// Clean up
keri_free_context(ctx);
return 0;
}
use kerir::keri::keri::Keri;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new KERI instance
let keri = Keri::new()?;
// Generate a new identifier
let (identifier, keypair) = keri.incept()?;
// Rotate the identifier's keys
let new_keypair = keri.rotate(identifier, keypair)?;
// Verify events
let verification = keri.verify(identifier)?;
println!("Verification result: {}", verification);
Ok(())
}
use kerir::keri::db::lmdber::LMDBer;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a database
let db = LMDBer::builder()
.name("my_database")
.temp(true)
.build()?;
// Open a database and perform operations
let env = db.env().unwrap();
let db_handle = env.create_db(Some("test_db"), lmdb::DatabaseFlags::empty())?;
// Insert data
let key = b"example_key".to_vec();
let value = b"example_value".to_vec();
db.put_val(&db_handle, &key, &value)?;
// Retrieve data
if let Some(retrieved) = db.get_val(&db_handle, &key)? {
println!("Retrieved: {}", String::from_utf8_lossy(&retrieved));
}
Ok(())
}
Generate and view the API documentation with:
cargo doc --open
This project is under active development. Not all features of the KERI protocol specification have been implemented yet.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the Apache License 2.0 - see the LICENSE file for details.