Conversation
Move library code into `coz-rs/` subdirectory to prepare for adding a CLI crate. Creates workspace root Cargo.toml with coz-rs as the first member. - Move src/ → coz-rs/src/ - Move Cargo.toml → coz-rs/Cargo.toml - Add workspace root Cargo.toml with resolver = "2"
Scaffold CLI crate with clap derive-based argument parsing. All commands stubbed with todo!() for Phase 4 implementation. Commands: newkey, tmb, sign, signpay, verify, meta, revoke
Replace String arguments with KeyInput, CozInput, and PayInput types. These implement FromStr for clap integration and provide file-or-JSON detection via the .load() method. - Add input.rs module with three input wrapper types - Update Command enum to use typed inputs - Update command handlers to accept typed inputs
Add key generation with algorithm dispatch (ES256, ES384, ES512, Ed25519).
Output is Coz JSON format: {"alg":"...","prv":"...","pub":"...","tmb":"..."}
Library changes:
- Add private_key_bytes() to KeyOps trait and SigningKey
- Make ops module public for downstream trait bounds
CLI changes:
- Implement cmd_newkey with algorithm match dispatch
- Add base64ct dependency for encoding
Add thumbprint calculation from key JSON input. Library changes: - Add compute_thumbprint_for_alg() for runtime algorithm dispatch - Export from lib.rs CLI changes: - Parse key JSON for alg and pub fields - Compute and print thumbprint
Add signature verification with runtime algorithm dispatch. Library changes: - Add verifying_key_from_bytes to KeyOps trait (all 4 algorithms) - Add verify_json() for runtime verification without type parameters - Export verify_json from lib.rs CLI changes: - Parse coz JSON for pay and sig fields - Parse key JSON for alg and pub fields - Call verify_json and print result (true/false)
Add payload signing with runtime algorithm dispatch. Library changes: - Add signing_key_from_bytes to KeyOps trait (all 4 algorithms) - Add sign_json() for runtime signing CLI changes: - Parse key JSON for alg, prv, pub, tmb fields - Augment pay with alg and tmb - Sign and output complete Coz message JSON
Add metadata display and key revocation support. Library changes: - Add canonical_hash_for_alg() for runtime cad computation - Add czd_for_alg() for runtime czd computation - Add revoke_json() for runtime revocation generation CLI changes: - meta: compute and display can, cad, czd - revoke: generate self-revocation Coz message
Add re-signing of existing Coz messages with a different key. CLI changes: - Extract pay from existing Coz message - Update alg and tmb to match new key - Sign with new key and output updated Coz
Library changes: - Add documentation to ops module and KeyOps trait CLI changes: - Remove unused raw() methods from input types
Add end-to-end tests for all CLI commands: - Key generation for all algorithms - Sign/verify roundtrip - Re-signing with different key - Meta computation - Key revocation - File path input handling Dev dependencies: assert_cmd, predicates, tempfile
Add comprehensive CLI documentation: - Installation via cargo install - All commands with examples - Complete example workflow - Update Related Projects section
Add docs/PUBLISHING.md with: - Crate links - Publishing order (coz-rs before coz-cli) - Step-by-step workflow - Version coordination guide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Rust CLI for Coz (
coz-cli)This PR introduces a complete command-line interface for Coz operations, built as a new crate within the repository.
Changes
Repository Structure
coz-rs(library) andcoz-cli(binary)Cargo.lockfor consistent dependency resolutionCLI Commands
coz newkey [ALG]coz tmb <KEY>coz signpay <PAY> <KEY>coz sign <COZ> <KEY>coz verify <COZ> <KEY>coz meta <COZ>coz revoke <KEY>Library Enhancements (
coz-rs)sign_json(),verify_json(), revoke_json()ops::KeyOpstrait public for downstream trait boundsTesting
Documentation
Dependencies
clap(derive) - Argument parsinganyhow- Error handlingbase64ct- Base64 encodingassert_cmd,predicates,tempfile- TestingUsage Example