#jose #zero-knowledge #jwk #elliptic-curve #jwp #jpt

json-proof-token

A library implementation based on the new JOSE Working Group draft specifications: JSON Web Proof (JWP), JSON Proof Token (JPT) and JSON Proof Algorithm (JPA)

25 releases

0.3.5 Apr 5, 2024
0.3.4 Mar 19, 2024
0.3.3 Feb 19, 2024
0.3.2 Jan 9, 2024
0.1.8 Nov 30, 2023

#217 in Cryptography

Download history 760/week @ 2024-07-21 551/week @ 2024-07-28 661/week @ 2024-08-04 1021/week @ 2024-08-11 1626/week @ 2024-08-18 891/week @ 2024-08-25 903/week @ 2024-09-01 808/week @ 2024-09-08 549/week @ 2024-09-15 641/week @ 2024-09-22 629/week @ 2024-09-29 665/week @ 2024-10-06 807/week @ 2024-10-13 391/week @ 2024-10-20 386/week @ 2024-10-27 609/week @ 2024-11-03

2,280 downloads per month
Used in 13 crates (4 directly)

Apache-2.0

94KB
2K SLoC

json-proof-token

License

Decoder

Here you can find a simple decoder for JSON Proof Tokens.

Description

Rust library implementing the new JOSE Working Group drafts:

The specification work for this can be found here.

Supported Features

JSON Web Keys (JWK)

JWK is defined in RFC 7517.

NOTE: To represent BLS keys this implementation refers to draft-ietf-cose-bls-key-representations-05.

JWKs are currently used in the proof generation and verification of JWPs.

The tables below represent which kty and crv are supported at momement.

JWK Key Type

Key Type Support
OKP
EC
RSA
oct

JWK Elliptic Curve

The standard list of Elliptic Curves can be found here:

Curve Name Support
P-256
P-384
P-521
secp256k1
Ed25519
Ed448
X25519
X448

This list is made from the currenlty active draft Barreto-Lynn-Scott Elliptic Curve Key Representations for JOSE and COSE - v05.

Curve Name Support
BLS12381G2
BLS12381G1
BLS48581G2
BLS48581G2

JSON Web Proof Algorithms

The supported algorithm are defined in in the JPA specification.

NOTE: Keep in mind that these specifications are in the early stages, and there is a high likelihood that they will undergo significant changes in the future.

Single Use

Algorithm Support Remarks
SU-ES256 Named here

BBS

These alg values are temporary and await an update to the official draft that will define names to support both ciphersuites specified in BBS+.:

  • BBS_BLS12381G1_XMD:SHA-256_SSWU_RO_H2G_HM2S_
  • BBS_BLS12381G1_XOF:SHAKE-256_SSWU_RO_H2G_HM2S_
Algorithm Support Remarks
BLS12381-SHA256
BLS12381-SHAKE256
BLS12381-SHA256-PROOF
BLS12381-SHAKE256-PROOF

MAC

These are defined here:

Algorithm Support Remarks
MAC-H256
MAC-H384
MAC-H512
MAC-K25519
MAC-K448
MAC-H256K

JSON Web Proof Serialization

Format Support
Compact
JSON

Getting Started

Requirements

Usage

Add this to your Cargo.toml:

[dependencies]
json-proof-token = "0.3.5"

Example

Take a look at the examples.

Tests

TBD

Dependencies

~15MB
~248K SLoC