Crate ndn_identity

Crate ndn_identity 

Source
Expand description

NDN identity management — high-level lifecycle for NDN identities.

ndn-identity provides NdnIdentity: a unified handle for an NDN signing identity that handles creation, enrollment via NDNCERT, persistent storage, and background certificate renewal.

§Quick start

use ndn_identity::NdnIdentity;

// Ephemeral (tests, quick prototypes)
let identity = NdnIdentity::ephemeral("/com/example/alice")?;

// Persistent — load or create
let identity = NdnIdentity::open_or_create(
    std::path::Path::new("/var/lib/ndn/identity"),
    "/com/example/alice",
)?;

// Use the signer
let signer = identity.signer()?;
println!("Identity: {}", identity.name());
println!("DID: {}", identity.did());

§Fleet provisioning

use ndn_identity::{NdnIdentity, DeviceConfig, FactoryCredential, RenewalPolicy};
use std::time::Duration;

let identity = NdnIdentity::provision(DeviceConfig {
    namespace: "/com/acme/fleet/VIN-123456".parse().unwrap(),
    storage: Some("/var/lib/ndn/device".into()),
    factory_credential: FactoryCredential::Token("factory-token-abc".to_string()),
    ca_prefix: Some("/com/acme/fleet/CA".parse().unwrap()),
    renewal: RenewalPolicy::WhenPercentRemaining(20),
    delegate: vec![],
}).await?;

Re-exports§

pub use ca::NdncertCa;
pub use ca::NdncertCaBuilder;
pub use device::DeviceConfig;
pub use device::FactoryCredential;
pub use device::RenewalPolicy;
pub use enroll::ChallengeParams;
pub use enroll::EnrollConfig;
pub use error::IdentityError;
pub use identity::NdnIdentity;

Modules§

ca
NdncertCa — a full NDNCERT CA that serves requests over the NDN network.
device
Fleet and device provisioning — zero-touch provisioning (ZTP) for NDN devices.
enroll
NDNCERT enrollment — interactive certificate issuance via the NDNCERT protocol.
error
identity
NdnIdentity — a named NDN identity with full lifecycle management.
renewal
Background certificate renewal task.