#ctap #webauthn #fido2 #passkey #passwordless

passkey-types

Rust type definitions for the webauthn and CTAP specifications

4 releases (2 breaking)

0.2.0 Dec 14, 2023
0.1.1 Jul 28, 2023
0.1.0 Feb 22, 2023
0.0.1 Feb 8, 2023

#841 in Authentication

Download history 1198/week @ 2023-12-13 1768/week @ 2023-12-20 779/week @ 2023-12-27 1851/week @ 2024-01-03 1612/week @ 2024-01-10 1939/week @ 2024-01-17 2303/week @ 2024-01-24 2212/week @ 2024-01-31 1695/week @ 2024-02-07 2285/week @ 2024-02-14 2602/week @ 2024-02-21 2268/week @ 2024-02-28 2021/week @ 2024-03-06 2270/week @ 2024-03-13 1449/week @ 2024-03-20

8,417 downloads per month
Used in 3 crates

MIT/Apache

190KB
2.5K SLoC

Passkey Types

github path Crates.io version crate documentation

This crate contains the types defined in both the WebAuthn Level 3 and CTAP 2.0 specifications for the operations they define. They are each separated in their own modules.

Webauthn

In this module the type names mirror exactly those in the specifications for ease of navigation. They are defined in a way that allows interoperability with the web types directly as well as the JSON encoding for over network communication.

Bytes Serialization

By default, the Bytes type serializes to an array of numbers for easy conversion to array buffers on the JavaScript side. However, if you are interacting with a server directly or wish to use this crate with Android's credential-manager library, you may wish this type to serialize to Base64Url. To do so, simply enable the crate feature serialize_bytes_as_base64_string. In the future we will work on changing this behavior dynamically.

CTAP 2

In this module, seeing as the method inputs are not given explicit names, the Request and Response types are defined in separate modules for each operation. These types make use of the same data structures from the WebAuthn module. In some cases though, the types have different constraits regarding required and optional fields, in which case it is re-defined in the CTAP module along with a TryFrom implementation in either direction.

Dependencies

~4–11MB
~109K SLoC