filament-crypto · identity
Source declarations, signatures and documentation for identity.
Read the current implementation boundaries before integration. This reference reproduces declarations; it omits source comments whose examples or readiness claims have not been verified.
Source: sigil/weave/filament/filament-crypto/src/identity.rs. SHA-256: ce1b6750f8c075043174dd9f7a462206465eb4337b5cd340f919fc25a7caf8d9.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
identity::IdentityError
#[derive(Error, Debug)]
pub enum IdentityError {
/// Key generation failed
#[error("key generation failed: {0}")]
KeyGeneration(String),
/// Signature verification failed
#[error("signature verification failed")]
InvalidSignature,
/// Invalid key material
#[error("invalid key material: {0}")]
InvalidKey(String),
/// Serialization/deserialization error
#[error("serialization error: {0}")]
Serialization(String),
}Source line: 50.
identity::Identity
#[derive(ZeroizeOnDrop)]
pub struct Identity {
}Source line: 73.
identity::Identity::generate
pub fn generate() -> Result<Self, IdentityError>;Source line: 101.
identity::Identity::from_bytes
pub fn from_bytes(
mut signing_key_bytes: [u8; 32],
mut encryption_key_bytes: [u8; 32],
) -> Result<Self, IdentityError>;Source line: 139.
identity::Identity::to_bytes
pub fn to_bytes(&self) -> ([u8; 32], [u8; 32]);Source line: 168.
identity::Identity::hash
#[inline]
pub fn hash(&self) -> [u8; 16];Source line: 178.
identity::Identity::verifying_key
#[inline]
pub fn verifying_key(&self) -> VerifyingKey;Source line: 184.
identity::Identity::encryption_public_key
#[inline]
pub fn encryption_public_key(&self) -> X25519PublicKey;Source line: 190.
identity::Identity::sign
pub fn sign(&self, message: &[u8]) -> [u8; 64];Source line: 211.
identity::Identity::verify
pub fn verify(&self, message: &[u8], signature: &[u8; 64]) -> bool;Source line: 232.
identity::Identity::key_exchange
pub fn key_exchange(&self, their_public: X25519PublicKey) -> [u8; 32];Source line: 262.
identity::Identity::public_identity
pub fn public_identity(&self) -> PublicIdentity;Source line: 267.
identity::PublicIdentity
#[derive(Clone, Copy, Debug)]
pub struct PublicIdentity {
/// Ed25519 verification key
pub verifying_key: VerifyingKey,
/// X25519 public key
pub encryption_key: X25519PublicKey,
/// Identity hash (16 bytes)
pub identity_hash: [u8; 16]
}Source line: 294.
identity::PublicIdentity::from_bytes
pub fn from_bytes(
verifying_key: &[u8; 32],
encryption_key: &[u8; 32],
) -> Result<Self, IdentityError>;Source line: 305.
identity::PublicIdentity::hash
#[inline]
pub fn hash(&self) -> [u8; 16];Source line: 326.
identity::PublicIdentity::verify
pub fn verify(&self, message: &[u8], signature: &[u8; 64]) -> bool;Source line: 331.
identity::PublicIdentity::to_bytes
pub fn to_bytes(&self) -> ([u8; 32], [u8; 32]);Source line: 337.