Pamoja.Audit
0.1.17
dotnet add package Pamoja.Audit --version 0.1.17
NuGet\Install-Package Pamoja.Audit -Version 0.1.17
<PackageReference Include="Pamoja.Audit" Version="0.1.17" />
<PackageVersion Include="Pamoja.Audit" Version="0.1.17" />
<PackageReference Include="Pamoja.Audit" />
paket add Pamoja.Audit --version 0.1.17
#r "nuget: Pamoja.Audit, 0.1.17"
#:package Pamoja.Audit@0.1.17
#addin nuget:?package=Pamoja.Audit&version=0.1.17
#tool nuget:?package=Pamoja.Audit&version=0.1.17
Pamoja.Audit
A tamper-evident, hash-chained log; altering, reordering, or dropping a record breaks verification. One capability of pamoja, one memory-safe Rust core with bindings for TypeScript, Python, and C#.
Install
dotnet add package Pamoja.Audit
using Pamoja.Audit;
This pulls in Pamoja.Native, the compiled engine, and Pamoja.Codec and Pamoja.Security. dotnet add package Pamoja is the whole framework in one package.
Example
The guide project's example, spliced here as it ran in CI.
From bindings/dotnet/samples/Pamoja.Guides/AuditGuide.cs:
// The controller signs its own log with a provisioned seed and an auditor holds
// only the public half, so a log can be checked anywhere without the device.
byte[] seed = new byte[32];
Array.Fill(seed, (byte)7);
using var keeper = new DeviceIdentity(seed);
byte[] auditor = keeper.PublicKey;
using var log = new AuditLog(keeper);
using AuditEntry lit = log.Append("burner=on"u8);
using AuditEntry stopped = log.Append("burner=off"u8);
Console.WriteLine($"recorded {lit.Index} then {stopped.Index}");
// Each record hashes its own index, the digest of the record before it, and what
// it carries, so the chain fixes the order as well as the contents.
Console.WriteLine($"chained {stopped.Previous.SequenceEqual(lit.Digest)}");
Audit.VerifyChain(auditor, [lit, stopped]);
Console.WriteLine("verified the whole log is authentic and in order");
// Editing a stored record changes the digest its signature covers.
byte[] edited = stopped.ToBytes();
edited[^1] ^= 0xFF;
using AuditEntry tampered = AuditEntry.FromBytes(edited);
try
{
Audit.VerifyChain(auditor, [lit, tampered]);
Console.WriteLine("an edited record verified, which should never happen");
}
catch (PamojaException error)
{
Console.WriteLine($"edited caught: {error.Message}");
}
// Dropping the first record leaves the survivor chained to a link that is no
// longer there, so a shortened log is caught as readily as an edited one.
try
{
Audit.VerifyChain(auditor, [stopped]);
Console.WriteLine("a shortened log verified, which should never happen");
}
catch (PamojaException error)
{
Console.WriteLine($"shortened caught: {error.Message}");
}
The same capability in every language
| Language | Package | Reference |
|---|---|---|
| Rust | pamoja-audit |
reference, docs.rs, install |
| TypeScript | @pamoja/audit |
reference, install |
| Python | pamoja-audit |
reference, install |
| C# | Pamoja.Audit |
reference, install |
Documentation
Pamoja.Auditreference, every type in this namespace.- The Audit log guide, with the same example in Rust, TypeScript, and Python.
- Every capability, and the install page.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Pamoja.Codec (>= 0.1.17)
- Pamoja.Native (>= 0.1.17)
- Pamoja.Security (>= 0.1.17)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pamoja.Audit:
| Package | Downloads |
|---|---|
|
Pamoja
The whole pamoja framework in one package: every capability of one memory-safe Rust core, behind an idiomatic C# facade, for IoT, robotics, and drones. |
|
|
Pamoja.Trust
Trust and operation: Proving what a node did, saying it in confidence, fixing it in the field, and deciding how often it can afford to do any of that. |
GitHub repositories
This package is not used by any popular GitHub repositories.