OpenAgentID documentation
Source referencesRust module referenceopenagent-server

openagent-server · verify

Declared module signatures, types, configuration, and source documentation.

Source: openagents/openagent.id/crates/openagent-server/src/verify.rs. SHA-256: 701f627e8d8e41643d91a128e645b64af8cc52a955e2d62354d5bbe63714edcd.

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.

verify::parse_authorization_header

Parses the Authorization: OpenAgent <sig>.<pubkey> header.

Returns (signature_bytes, public_key_bytes) on success.

pub fn parse_authorization_header(header_value: &str) -> Result<(Vec<u8>, [u8; 32]), VerifyError>;

Source line: 14.

verify::verify_ed25519

Verifies an Ed25519 signature over JCS-canonicalized challenge bytes.

Arguments

  • pubkey - 32-byte Ed25519 public key
  • signature_bytes - 64-byte Ed25519 signature
  • challenge_jcs_bytes - The JCS-canonicalized challenge JSON
pub fn verify_ed25519(
    pubkey: &[u8; 32],
    signature_bytes: &[u8],
    challenge_jcs_bytes: &[u8],
) -> Result<(), VerifyError>;

Source line: 57.

verify::VerifyError

#[derive(Debug, thiserror::Error)]
pub enum VerifyError {
    #[error("malformed Authorization header: {0}")]
    MalformedHeader(String),

    #[error("invalid base64url encoding in {0}")]
    InvalidBase64(&'static str),

    #[error("public key length {actual} does not match expected {expected}")]
    InvalidKeyLength { expected: usize, actual: usize },

    #[error("signature length {actual} does not match expected {expected}")]
    InvalidSignatureLength { expected: usize, actual: usize },

    #[error("invalid Ed25519 public key: {0}")]
    InvalidPublicKey(String),

    #[error("Ed25519 signature verification failed")]
    SignatureInvalid,
}

Source line: 82.

On this page