Expand description
A library to work with Javascript Object Signing and Encryption(JOSE), including JSON Web Tokens (JWT), JSON Web Signature (JWS) and JSON Web Encryption (JWE)
This was based off Keats/rust-jwt
.
§Installation
Add the following to Cargo.toml:
biscuit = "0.7.0"
To use the latest master
branch, for example:
biscuit = { git = "https://github.com/lawliet89/biscuit", branch = "master" }
See JWT
for common usage examples.
§Supported Features
The crate does not support all, and probably will never support all of the features described in the various RFCs, including some algorithms and verification.
See the documentation for more information.
§References
- JWT Handbook — great introduction to JWT
- IANA JOSE Registry
§RFCs
Modules§
- digest
- Secure cryptographic digests
- errors
- Errors returned will be converted to one of the structs in this module.
- jwa
- JSON Web Algorithms
- jwe
- JSON Web Encryption
- jwk
- JSON Web Key
- jws
- JSON Web Signatures, including JWT signing and headers
Structs§
- Base64
Url - A newtype wrapper around a string to indicate it’s base64 URL encoded
- Claim
Presence Options - Options for claims presence validation
- Claims
Set - A collection of claims, both registered and your custom private claims.
- Compact
- A collection of
CompactPart
s that have been converted toBase64Url
- Empty
- An empty struct that derives Serialize and Deserialize. Can be used, for example, in places where a type
for custom values (such as private claims in a
ClaimsSet
) is required but you have nothing to implement. - Registered
Claims - Registered claims defined by RFC7519#4.1
- Temporal
Options - Options for validating temporal claims
- Timestamp
- Wrapper around
DateTime<Utc>
to allow us to do custom de(serialization) - Validation
Options - Options for claims validation
Enums§
- Presence
- Defines whether a claim is required or not
- Single
OrMultiple - Represents a choice between a single value or multiple values. This value is serialized by serde untagged.
- Validation
- Defines whether a claim is validated or not
Traits§
- Compact
Json - A marker trait that indicates that the object is to be serialized to JSON and deserialized from JSON.
This is primarily used in conjunction with the
CompactPart
trait which will serialize structs to JSON before base64 encoding, and vice-versa. - Compact
Part - A “part” of the compact representation of JWT/JWS/JWE. Parts are first serialized to some form and then base64 encoded and separated by periods.