Crates.io | cclm |
lib.rs | cclm |
version | 0.0.1 |
source | src |
created_at | 2023-02-07 18:51:26.530224 |
updated_at | 2023-02-07 18:51:26.530224 |
description | The `Claims` library holds JSON Web Token (JWT) cclm. It provides an RFC7519 compliant implementation of JSON Web Tokens (JWT) and JSON Web Signature (JWS) for Rust. |
homepage | https://minifunctions.com/ |
repository | https://github.com/sebastienrousseau/mini-functions/tree/main/cclm/ |
max_upload_size | |
id | 779015 |
size | 44,630 |
A Rust library for accessing and manipulating claims of a JSON Web Token (JWT)
Website âĸ Documentation âĸ Report Bug âĸ Request Feature âĸ Contributing Guidelines
The Claims library holds JSON Web Token (JWT) claims. It provides an RFC7519 compliant implementation of JSON Web Tokens (JWT) and JSON Web Signature (JWS) for Rust.
The Claims
type is provided to hold
the claims of a JWT. The claims are stored in a HashMap
and can be
accessed using the get_claim
, set_claim
, remove_claim
, and
has_claim
methods.
The following table lists the optional reserved claims that are supported:
Claim | Description |
---|---|
aud (Audience) |
Identifies the recipients that the JWT is intended for. |
custom (Custom) |
Custom claims are used to share information between parties that agree on using them and are neither registered or public claims. |
did (Decentralized Identifier) |
A string value that uniquely identifies a subject. |
exp (Expiration Time) |
Identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. |
iat (Issued At) |
Identifies the time at which the JWT was issued. |
iss (Issuer) |
Identifies the principal that issued the JWT. |
jti (JWT ID) |
Provides a unique identifier for the JWT. |
nbf (Not Before) |
Identifies the time before which the JWT MUST NOT be accepted for processing. |
sub (Subject) |
Identifies the principal that is the subject of the JWT. |
vc (Verifiable Credential) |
A Credential that is tamper-evident and has authorship that can be cryptographically verified. |
vp (Verifiable Presentation) |
A Presentation that is tamper-evident and has authorship that can be cryptographically verified. |
It takes just a few minutes to get up and running with cclm
.
cclm
requires Rust 1.67.0 or later.
âšī¸ Info: Please check out our website for more information and find our documentation on docs.rs, lib.rs and crates.io.
To use cclm
in your project, add the following to your
Cargo.toml
file:
[dependencies]
cclm = "0.0.1"
Add the following to your main.rs
file:
extern crate cclm;
use cclm::*;
then you can use the functions in your application code.
CCLM
comes with a set of examples that you can use to get started. The
examples are located in the examples
directory of the project. To run
the examples, clone the repository and run the following command in your
terminal from the project root directory.
cargo run --example cclm
For transparency into our release cycle and in striving to maintain
backward compatibility, QRC
follows semantic versioning.
The project is licensed under the terms of both the MIT license and the Apache License (Version 2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
A big thank you to all the awesome contributors of Mini Functions for their help and support. A special thank you goes to the Rust Reddit community for providing a lot of useful suggestions on how to improve this project. A special thank you goes to the Rust Reddit community for providing a lot of useful suggestions on how to improve this project.