Rustls WebPKI library
  • Rust 96.6%
  • Python 2.8%
  • Shell 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
kade 967b5fa204
Some checks failed
ci / Format (push) Has been cancelled
ci / Clippy (push) Has been cancelled
ci / Cargo Deny (push) Has been cancelled
ci / Check for documentation errors (push) Has been cancelled
ci / Check for documentation errors-1 (push) Has been cancelled
ci / Check for documentation errors-2 (push) Has been cancelled
ci / Cargo Package (push) Has been cancelled
ci / Build+test (push) Has been cancelled
ci / Build+test-1 (push) Has been cancelled
ci / Build+test-2 (push) Has been cancelled
ci / Build+test-3 (push) Has been cancelled
ci / Build+test-4 (push) Has been cancelled
ci / MSRV (push) Has been cancelled
ci / Check cross compilation targets (push) Has been cancelled
ci / Check semver compatibility (push) Has been cancelled
ci / Validate external types appearing in public API (push) Has been cancelled
ci / Measure coverage (push) Has been cancelled
ci / Verify that no-std modes do not rely on libstd (push) Has been cancelled
ci / Verify that no-std modes do not rely on libstd-1 (push) Has been cancelled
ci / Feature Powerset (push) Has been cancelled
Fuzz / Fuzz Testing (push) Has been cancelled
revert a6e549d50d
revert Update version to 0.103.9 and use git.sly.so rustls-pki-types
2026-05-11 14:33:06 +02:00
.github fuzz: add basic parser fuzz coverage 2026-04-21 17:43:39 +00:00
benches Hoist Rust lints to Cargo.toml 2025-12-11 14:57:28 +00:00
fuzz fuzz: add basic parser fuzz coverage 2026-04-21 17:43:39 +00:00
src verify_cert: expose builder-like interface for path verification 2026-05-09 12:25:51 +00:00
tests verify_cert: expose builder-like interface for path verification 2026-05-09 12:25:51 +00:00
third-party tests: avoid vendored limbo.json 2026-04-21 18:16:44 +00:00
.flake8 tests: fix flake8 warns, add config. 2023-05-16 22:33:40 +02:00
.gitattributes Treat *.der as binary in .gitattributes. 2016-11-21 12:30:09 -10:00
.gitignore Add Cargo.lock and use it in CI 2024-02-22 16:45:59 +00:00
Cargo.lock tests: avoid vendored limbo.json 2026-04-21 18:16:44 +00:00
Cargo.toml revert a6e549d50d 2026-05-11 14:33:06 +02:00
CONTRIBUTING.md docs: add CONTRIBUTING.md, ref'ing Rustls CONTRIBUTING 2023-09-14 14:23:58 +00:00
deny.toml tests: add x509-limbo coverage 2026-04-21 13:03:43 +00:00
LICENSE Import Chromium's |verify_signed_data| test data. 2015-08-27 10:23:28 -07:00
mypy.ini tests: add mypy typechecking and enforcement. 2023-05-16 22:33:40 +02:00
README.md docs: update README w.r.t cryptography providers 2026-03-21 19:25:33 +00:00
requirements.txt build(deps): bump cryptography from 44.0.0 to 44.0.1 2025-02-24 12:03:12 +00:00
rustfmt.toml rustfmt: style_edition 2024 2025-02-21 14:49:38 +00:00
SECURITY.md SECURITY.md: update release line statuses 2026-03-24 09:03:43 +00:00

Build Status Coverage Status (codecov.io) Documentation Chat

webpki is a library that validates Web PKI (TLS/SSL) certificates. It's used by Rustls to handle certificate-related tasks required for implementing TLS clients and servers.

webpki is written in Rust. It does not provide any built-in cryptography providers, but was written to interoperate with the rustls-aws-lc-rs and rustls-ring crates, or a custom implementation of the rustls CryptoProvider struct backed by your cryptography library of choice.

This is a fork of the original webpki project which adds a number of features required by the rustls project. This fork is released as the rustls-webpki crate, with versions starting 0.100.0 so as to not confusingly overlap with webpki versions.

Features

  • Representing trust anchors - webpki requires the caller to bootstrap trust by explicitly specifying a set of trust anchors using the TrustAnchor type.

  • Parsing certificates - webpki can convert from the raw encoded form of a certificate into something that can be used for making trust decisions.

  • Path building - webpki can determine if a certificate for an end entity like a website or client identity was issued by a trust anchor, or a series of intermediate certificates the trust anchor has endorsed.

  • Name/usage validation - webpki can determine if a certificate is valid for a given DNS name or IP address by considering the allowed usage of the certificate and additional constraints.

Limitations

webpki offers a minimal feature set tailored to the needs of Rustls. Notably it does not offer:

  • Support for self-signed certificates
  • Certificate or keypair generation
  • Access to arbitrary certificate extensions
  • Parsing/representation of certificate subjects, or human-friendly display of these fields

For these tasks you may prefer using webpki in combination with libraries like x509-parser and rcgen.

Changelog

Release history can be found on GitHub.

Demo

See https://github.com/rustls/rustls#example-code for an example of using webpki.

License

See LICENSE. This project happily accepts pull requests without any formal copyright/contributor license agreement.

Bug Reporting

Please refer to the SECURITY policy for security issues. All other bugs should be reported as GitHub issues.