| Crates.io | intentrail |
| lib.rs | intentrail |
| version | 0.1.0 |
| created_at | 2025-12-31 15:30:30.310266+00 |
| updated_at | 2025-12-31 15:30:30.310266+00 |
| description | Rust SDK for creating, validating, and verifying IntentRail manifests |
| homepage | |
| repository | https://github.com/intentrail/intentrail |
| max_upload_size | |
| id | 2014894 |
| size | 52,450 |
Rust SDK for creating, validating, and verifying IntentRail manifests.
Add to your Cargo.toml:
[dependencies]
intentrail = "0.1"
use intentrail::{IntentManifest, verify_intent, VerifyOptions};
// Parse from JSON
let json = r#"{"intent_version":"1.0",...}"#;
let manifest: IntentManifest = serde_json::from_str(json)?;
// Verify
let result = verify_intent(&manifest, &VerifyOptions::default())?;
if result.ok {
println!("Intent is valid");
} else {
for error in result.errors {
println!("Error: {}", error.message);
}
}
use intentrail::{hash_manifest_hex, canonicalize_manifest};
// Get canonical form
let canonical = canonicalize_manifest(&manifest)?;
// Get SHA-256 hash
let hash = hash_manifest_hex(&manifest)?;
println!("Hash: {}", hash);
use intentrail::{verify_signature, verify_intent, VerifyOptions};
// Verify a specific signature
let is_valid = verify_signature(&manifest, "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV")?;
// Verify with required signers
let options = VerifyOptions {
required_signers: vec!["7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV".to_string()],
..Default::default()
};
let result = verify_intent(&manifest, &options)?;
The canonicalization and hashing in this crate produce identical output to the TypeScript and Python SDKs. This is verified by shared test fixtures.
MIT