OpenAgentID documentation
Source referencesRust module referencearsenal-crypto

arsenal-crypto · token_signer

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

Source: arsenal/crates/arsenal-crypto/src/token_signer.rs. SHA-256: d4f36288952c34e71c4fda2e0009a691212dd6abe71f5a77eed5938fcbe90c18.

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.

token_signer::TokenSigner

Token signer for creating signed ACTs

pub struct TokenSigner {

}

Source line: 46.

token_signer::TokenSigner::new

Create a new token signer

#[must_use]
pub fn new(key_pair: SigningKeyPair, issuer: impl Into<String>) -> Self;

Source line: 56.

token_signer::TokenSigner::key_id

Get the key ID

#[must_use]
pub fn key_id(&self) -> &KeyId;

Source line: 65.

token_signer::TokenSigner::public_key

Get the public key for verification

#[must_use]
pub fn public_key(&self) -> PublicSigningKey;

Source line: 71.

token_signer::TokenSigner::issuer

Get the issuer

#[must_use]
pub fn issuer(&self) -> &str;

Source line: 77.

token_signer::TokenSigner::sign

Sign a token

Errors

Returns an error if signing fails

pub fn sign(&self, token: &mut AgentCapabilityToken) -> ArsenalResult<()>;

Source line: 85.

token_signer::TokenSigner::sign_token

Sign and return a new token

Errors

Returns an error if signing fails

pub fn sign_token(
        &self,
        mut token: AgentCapabilityToken,
    ) -> ArsenalResult<AgentCapabilityToken>;

Source line: 104.

token_signer::TokenVerifier

Token verifier for validating signed ACTs

pub struct TokenVerifier {

}

Source line: 123.

token_signer::TokenVerifier::new

Create a new token verifier

#[must_use]
pub fn new() -> Self;

Source line: 135.

token_signer::TokenVerifier::with_public_key

Add a public key for verification

#[must_use]
pub fn with_public_key(mut self, key: PublicSigningKey) -> Self;

Source line: 145.

token_signer::TokenVerifier::with_public_keys

Add multiple public keys

#[must_use]
pub fn with_public_keys(mut self, keys: Vec<PublicSigningKey>) -> Self;

Source line: 152.

token_signer::TokenVerifier::with_expected_issuers

Set expected issuers

#[must_use]
pub fn with_expected_issuers(mut self, issuers: Vec<String>) -> Self;

Source line: 159.

token_signer::TokenVerifier::with_expected_audiences

Set expected audiences

#[must_use]
pub fn with_expected_audiences(mut self, audiences: Vec<String>) -> Self;

Source line: 166.

token_signer::TokenVerifier::verify

Verify a token

Errors

Returns an error if verification fails

pub fn verify(&self, token: &AgentCapabilityToken) -> ArsenalResult<VerificationResult>;

Source line: 175.

token_signer::VerificationResult

Result of token verification

#[derive(Debug, Clone)]
pub struct VerificationResult {
/// Key ID that verified the token

pub verified_by: KeyId,
/// Whether the claims are valid

pub claims_valid: bool
}

Source line: 269.

token_signer::SignedToken

Signed token for transport

#[derive(Clone, Serialize, Deserialize)]
pub struct SignedToken {
/// The token in CBOR format

pub token_cbor: Vec<u8>,
/// Base64-encoded signature

pub signature_base64: String,
/// Key ID used for signing

pub key_id: String,
/// Algorithm

pub algorithm: String
}

Source line: 278.

token_signer::SignedToken::from_token

Create from a signed token

Errors

Returns an error if the token is not signed

pub fn from_token(token: &AgentCapabilityToken) -> ArsenalResult<Self>;

Source line: 294.

token_signer::SignedToken::to_token

Restore the token

Errors

Returns an error if deserialization fails

pub fn to_token(&self) -> ArsenalResult<AgentCapabilityToken>;

Source line: 316.

token_signer::SignedToken::to_compact

Encode as compact string (base64 CBOR)

#[must_use]
pub fn to_compact(&self) -> String;

Source line: 322.

token_signer::SignedToken::from_compact

Decode from compact string

Errors

Returns an error if decoding fails

pub fn from_compact(compact: &str) -> ArsenalResult<AgentCapabilityToken>;

Source line: 331.

On this page