Expand description
Shared types and utilities for the IronShield PoW system
This crate contains the common data structures and serialization utilities used across ironshield-core, ironshield-cloudflare, and ironshield-wasm.
Re-exports§
pub use chrono;
Structs§
- Iron
Shield Challenge - Iron
Shield Challenge Response - Iron
Shield Request endpoint
: The endpoint URL for the request.timestamp
: The timestamp of the request in unix millis.- Iron
Shield Token - Signing
Key - ed25519 signing key which can be used to produce signatures.
Enums§
Constants§
Functions§
- concat_
struct_ base64url_ decode - Decodes a Base64 URL-safe encoded string into a concatenated string.
- concat_
struct_ base64url_ encode - Encodes a concatenated string into a Base64 URL-safe format without padding.
- create_
signing_ message - Creates a message to be signed from challenge data components
- deserialize_
32_ bytes - Custom serialization for 32-byte arrays (challenge params, public keys)
- deserialize_
signature - Custom deserialization for 64-byte arrays (Ed25519 signatures)
- generate_
signature - Generates an Ed25519 signature for a given message using the provided signing key
- generate_
test_ keypair - Generates a new Ed25519 keypair for testing purposes
- load_
private_ key_ from_ data - Loads a private key from raw key data (for Cloudflare Workers)
- load_
private_ key_ from_ env - Loads the private key from the IRONSHIELD_PRIVATE_KEY environment variable
- load_
public_ key_ from_ data - Loads a public key from raw key data (for Cloudflare Workers)
- load_
public_ key_ from_ env - Loads the public key from the IRONSHIELD_PUBLIC_KEY environment variable
- serialize_
32_ bytes - Custom serialization for 32-byte arrays (challenge params, public keys).
- serialize_
signature - Custom serialization for 64-byte arrays (Ed25519 signatures)
- sign_
challenge - Signs a challenge using the private key from environment variables.
- validate_
challenge - Verifies a challenge and checks if it’s valid and not expired
- verify_
challenge_ signature - Verifies a challenge signature using the public key from environment variables
- verify_
challenge_ signature_ with_ key - Verifies a challenge signature using a provided public key