{"id":51121822,"url":"https://github.com/tegmentum/pkcs11-x509","last_synced_at":"2026-06-25T03:30:32.187Z","repository":{"id":363221964,"uuid":"1261957138","full_name":"tegmentum/pkcs11-x509","owner":"tegmentum","description":"X.509 certificate path (chain-to-anchor) validation for the pkcs11* / openssl-provider-wit stack — the policy layer above PKCS#11. Native crate + WIT component; pluggable native/HSM verify.","archived":false,"fork":false,"pushed_at":"2026-06-08T00:03:26.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-08T02:12:51.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tegmentum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T11:38:13.000Z","updated_at":"2026-06-08T00:03:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tegmentum/pkcs11-x509","commit_stats":null,"previous_names":["tegmentum/pkcs11-x509"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tegmentum/pkcs11-x509","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegmentum%2Fpkcs11-x509","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegmentum%2Fpkcs11-x509/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegmentum%2Fpkcs11-x509/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegmentum%2Fpkcs11-x509/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tegmentum","download_url":"https://codeload.github.com/tegmentum/pkcs11-x509/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tegmentum%2Fpkcs11-x509/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34758773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-25T03:30:31.541Z","updated_at":"2026-06-25T03:30:32.170Z","avatar_url":"https://github.com/tegmentum.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pkcs11-x509\n\nX.509 certificate **path validation** for the `pkcs11*` / `openssl-provider-wit`\nstack — the policy layer *above* PKCS#11.\n\nPKCS#11 (and the `tegmentum:key-backend` contract) gives you key operations:\nsign, **verify**, decrypt, derive. It deliberately does *not* parse X.509 or\nbuild/validate certificate chains. This crate fills that gap: given a leaf\ncertificate, a set of trusted anchors (a `db`), and a revocation set (a `dbx`),\nit decides whether the leaf **chains to a trusted anchor** — verifying each\nlink's signature, validity window, CA constraints, and revocation.\n\nIt was extracted as a shared component because the need recurs: Secure Boot\n`db`/`dbx` authority validation (Citadel's measured-boot appraisal), verifying a\npeer/client cert chains to an org CA, validating a signed-artifact publisher,\netc. — all want \"does this cert chain to something I trust,\" not raw\nkey-by-key matching.\n\n## Layout\n\n* **`x509-path/`** — the native Rust core (this is the dependency other projects\n  use directly; pure-Rust, wasm-friendly, no wasmtime on the hot path).\n* **`x509-path-component/`** — a thin WASM **Component** wrapper exporting\n  `tegmentum:x509-path/validation`, for the component-model stack. Backed by the\n  same core. (Not a default workspace member — build with the wasm toolchain.)\n* **`wit/`** — the `tegmentum:x509-path` WIT contract.\n\n## Native usage\n\n```rust\nuse x509_path::{Cert, TrustStore, Revocations, NativeVerifier, validate_chain};\n\nlet leaf = Cert::from_der(leaf_der)?;\nlet store = TrustStore::from_ders([root_ca_der])?;          // the db\nlet mut dbx = Revocations::empty();                         // the dbx\ndbx.revoke_der(compromised_cert_der);\n\nmatch validate_chain(\u0026leaf, \u0026intermediates, \u0026store, \u0026dbx, now_unix, \u0026NativeVerifier) {\n    Ok(v)  =\u003e println!(\"authorized by {}\", v.anchor_subject),\n    Err(e) =\u003e println!(\"rejected: {e}\"),\n}\n```\n\n## Pluggable signature verification\n\nThe per-link signature check goes through the [`CertVerifier`] trait. The\ndefault [`NativeVerifier`] uses pure-Rust crypto (`x509-verify`: RSA / ECDSA /\nEd25519). To verify on an HSM, implement `CertVerifier` over the PKCS#11\n`verify()` primitive (`pkcs11-bridge` / `tegmentum:key-backend`) — parse + chain\nlogic stays here, the crypto runs on the token.\n\n## Assurance boundary\n\nChecked: issuer/subject chaining, per-link signature, validity window (against a\ncaller-supplied time), CA basic-constraints on issuers, and revocation by\ncertificate-DER hash. **Not yet** checked: name constraints, EKU, policy\nconstraints, path-length constraints. State this when relying on it for\nhigh-assurance trust decisions.\n\n## Building the component\n\n```sh\ncargo build --release --target wasm32-wasip2 \\\n  --manifest-path x509-path-component/Cargo.toml\n```\n\n## License\n\nMIT OR Apache-2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftegmentum%2Fpkcs11-x509","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftegmentum%2Fpkcs11-x509","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftegmentum%2Fpkcs11-x509/lists"}