arsenal-crypto · signing
Declared module signatures, types, configuration, and source documentation.
Source: arsenal/crates/arsenal-crypto/src/signing.rs. SHA-256: 3da22c23604ef895aad9ac28d81e12413f8a25039673e5024fd2f95e6a2309cd.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
signing::Signature
A detached Ed25519 signature
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Signature {
}Source line: 15.
signing::signature_bytes::serialize
pub fn serialize<S>(bytes: &[u8; 64], serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,;Source line: 27.
signing::signature_bytes::deserialize
pub fn deserialize<'de, D>(deserializer: D) -> Result<[u8; 64], D::Error>
where
D: Deserializer<'de>,;Source line: 40.
signing::Signature::from_bytes
Create a signature from bytes
#[must_use]
pub fn from_bytes(bytes: [u8; 64], key_id: KeyId) -> Self;Source line: 66.
signing::Signature::as_bytes
Get the signature bytes
#[must_use]
pub fn as_bytes(&self) -> &[u8; 64];Source line: 72.
signing::Signature::key_id
Get the key ID
#[must_use]
pub fn key_id(&self) -> &KeyId;Source line: 78.
signing::Signature::to_base64
Encode as base64
#[must_use]
pub fn to_base64(&self) -> String;Source line: 84.
signing::Signature::from_base64
Decode from base64
Errors
Returns an error if decoding fails
pub fn from_base64(encoded: &str, key_id: KeyId) -> ArsenalResult<Self>;Source line: 93.
signing::Signer
Trait for types that can sign messages
pub trait Signer {
/// Sign a message
fn sign(&self, message: &[u8]) -> Signature;
/// Get the key ID
fn key_id(&self) -> &KeyId;
}Source line: 122.
signing::Verifier
Trait for types that can verify signatures
pub trait Verifier {
/// Verify a signature
///
/// # Errors
/// Returns an error if verification fails
fn verify(&self, message: &[u8], signature: &Signature) -> ArsenalResult<()>;
/// Get the key ID
fn key_id(&self) -> &KeyId;
}Source line: 142.
signing::SignedData
Signed data container
#[derive(Clone, Serialize, Deserialize)]
pub struct SignedData<T> {
/// The data
pub data: T,
/// The signature over the serialized data
pub signature: Signature
}Source line: 165.
signing::SignedData<T>::sign
Create signed data
Errors
Returns an error if serialization fails
pub fn sign(data: T, signer: &impl Signer) -> ArsenalResult<Self>;Source line: 177.
signing::SignedData<T>::verify
Verify the signature
Errors
Returns an error if verification fails
pub fn verify(&self, verifier: &impl Verifier) -> ArsenalResult<()>;Source line: 189.
signing::MultiSignature
Multi-signature container for threshold signing
#[derive(Clone, Serialize, Deserialize)]
pub struct MultiSignature {
}Source line: 218.
signing::MultiSignature::new
Create a new multi-signature container
#[must_use]
pub fn new(threshold: usize) -> Self;Source line: 228.
signing::MultiSignature::add_signature
Add a signature
pub fn add_signature(&mut self, signature: Signature);Source line: 236.
signing::MultiSignature::is_complete
Check if threshold is met
#[must_use]
pub fn is_complete(&self) -> bool;Source line: 249.
signing::MultiSignature::count
Get the number of signatures
#[must_use]
pub fn count(&self) -> usize;Source line: 255.
signing::MultiSignature::threshold
Get the threshold
#[must_use]
pub fn threshold(&self) -> usize;Source line: 261.
signing::MultiSignature::signatures
Get the signatures
#[must_use]
pub fn signatures(&self) -> &[Signature];Source line: 267.
signing::MultiSignature::verify_all
Verify all signatures against a message
Errors
Returns an error if any signature is invalid or threshold not met
pub fn verify_all(&self, message: &[u8], verifiers: &[&impl Verifier]) -> ArsenalResult<()>;Source line: 275.
signing::sign_consent_record
Sign a consent record's canonical bytes.
The consent record should be serialized to its canonical form
(via [arsenal_core::consent::ConsentRecord::signing_bytes]) before
calling this function.
Errors
Returns an error if signing fails.
#[must_use]
pub fn sign_consent_record(key: &SigningKeyPair, record_bytes: &[u8]) -> Signature;Source line: 328.
signing::verify_consent_signature
Verify a consent record's signature.
The consent record should be serialized to its canonical form
(via [arsenal_core::consent::ConsentRecord::signing_bytes]) before
calling this function.
Errors
Returns an error if verification fails.
pub fn verify_consent_signature(
key: &PublicSigningKey,
record_bytes: &[u8],
signature: &Signature,
) -> ArsenalResult<bool>;Source line: 341.