#x509 #pki #asn-1 #signature-verification #extension

no-std x509-signature

Low-level X.509 parsing and signature verification library

4 releases (breaking)

0.5.0 Jul 8, 2020
0.4.0 May 1, 2020
0.3.3 Apr 21, 2020
0.2.0 Apr 8, 2020
0.1.0 Apr 8, 2020

#23 in #asn1

Download history 2002/week @ 2024-04-04 1728/week @ 2024-04-11 1313/week @ 2024-04-18 1318/week @ 2024-04-25 1427/week @ 2024-05-02 1593/week @ 2024-05-09 1251/week @ 2024-05-16 740/week @ 2024-05-23 1235/week @ 2024-05-30 891/week @ 2024-06-06 1211/week @ 2024-06-13 1462/week @ 2024-06-20 916/week @ 2024-06-27 1369/week @ 2024-07-04 987/week @ 2024-07-11 1446/week @ 2024-07-18

4,881 downloads per month
Used in 9 crates (2 directly)

MIT/Apache

51KB
942 lines

A low-level X.509 parsing and certificate signature verification library.

x509-signature can verify the signatures of X.509 certificates, as well as certificates made by their private keys. It can also verify that a certificate is valid for the given time. However, it is (by design) very low-level: it does not know about any X.509 extensions, and does not parse distinguished names at all. It also provides no path-building facilities. As such, it is not intended for use with the web PKI; use webpki for that.

x509-signature’s flexibiity is a double-edged sword: it allows it to be used in situations where webpki cannot be used, but it also makes it significantly more dangerous. As a general rule, x509-signature will accept any certificate that webpki will, but it will also accept certificates that webpki will reject. If you find a certificate that x509-signature rejects and webpki rejects, please report it as a bug.

x509-signature was developed for use with libp2p, which uses certificates that webpki cannot handle. Its bare-bones design ensures that it can handle almost any conforming X.509 certificate, but it also means that the application is responsible for ensuring that the certificate has valid X.509 extensions. x509-signature cannot distinguish between a certificate valid for mozilla.org and one for evilmalware.com! However, x509-signature does provide the hooks needed for higher-level libraries to be built on top of it.

Like webpki, x509-signature is zero-copy and #![no_std] friendly. If built without the alloc feature, x509-signature will not rely on features of ring that require heap allocation, specifically RSA. x509-signature should never panic on any input.

License

x509-signature is dual-licensed under the MIT license and the Apache License, Version 2.0, at your option.

Dependencies

~5.5–7.5MB
~229K SLoC