6个版本
0.4.0 | 2022年3月7日 |
---|---|
0.3.4 | 2021年4月23日 |
0.3.2 | 2021年3月24日 |
0.1.0 |
|
#329 在 身份认证
每月128次下载
18KB
263 代码行
PASSporT: 个人断言令牌
覆盖率 | 流水线 |
---|---|
此Crate实现了RFC8225的个人断言令牌,用于在个人通信的发起方和接收方之间建立信任。
贡献
欢迎拉取请求。对于重大更改,请首先打开一个问题来讨论您想要更改的内容。
请确保适当地更新测试。
许可证
lib.rs
:
passport-rs
一个用于生成遵循RFC-8225的JWT护照的库
使用方法
let passport_builder =
passport::PassportBuilder::new(String::from("https://cert.example.org/passport.cer"), passport::Identity::URI(String::from("https://matrix.to/#/@alice:example.org")))
.add_destination(passport::Identity::URI(String::from("https://matrix.to/#/@bob:example.org")))
.set_expires_in(Some(512));
let jwt = passport_builder.encode(
&passport::EncodingKey::from_secret(b"test_secret"),
passport::Algorithm::HS512,
).unwrap();
依赖关系
~6.5–9MB
~256K SLoC