From 2e4a332a418e558ab68187576f0a8f1b807e1f04 Mon Sep 17 00:00:00 2001 From: Yong Wen Chua Date: Sun, 23 Apr 2017 14:35:26 +0800 Subject: [PATCH] Add missing documentation for supported features --- doc/supported.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- src/jwk.rs | 4 ++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/doc/supported.md b/doc/supported.md index 20deb71c..394529e9 100644 --- a/doc/supported.md +++ b/doc/supported.md @@ -64,9 +64,20 @@ JWK is currently not used in signing JWS, pending features in `ring`. See this | `x5t` | ✘ | Can be (de)serialized; but no processing is handled at the moment. | | `x5t#S256` | ✘ | Cannot be (de)serialized. | -### JWK Key Types +#### JWK Key Types -The key +The list of key types can be found +[here](https://www.iana.org/assignments/jose/jose.xhtml#web-key-types). + +_Support in the table below simply means that they can be (de)serialized from JSON input._ Support +for their use with the various algorithms is listed in the relevant section on this page. + +| Key Type | Support | Remarks | +|:--------:|:-------:|:-------:| +| `EC` | ✔ | | +| `RSA` | ✔ | | +| `oct` | ✔ | | +| `OKP` | ✘ | | ### JWK Parameters for Elliptic Curve Keys @@ -76,6 +87,20 @@ The key | `x` | ✘ | Can be (de)serialized; but cannot be used in signing and verification yet pending support from `ring`. | | `y` | ✘ | Can be (de)serialized; but cannot be used in signing and verification yet pending support from `ring`. | +#### JWK Elliptic Curve + +The list of key types can be found +[here](https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve). + +_Support in the table below simply means that they can be (de)serialized from JSON input._ Support +for their use with the various algorithms is listed in the relevant section on this page. + +| Key Type | Support | Remarks | +|:--------:|:-------:|:--------------------------------------------------------------------:| +| `P-256` | ✔ | | +| `P-384` | ✔ | | +| `P-521` | ✘ | [No plan to support.](https://github.com/briansmith/ring/issues/268) | + ### JWK Parameters for RSA Keys | Parameter | Support | Remarks | @@ -107,6 +132,21 @@ The key | `x` | ✘ | | | `d` | ✘ | | +#### JWK Elliptic Curve + +The list of key types can be found +[here](https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve). + +_Support in the table below simply means that they can be (de)serialized from JSON input._ Support +for their use with the various algorithms is listed in the relevant section on this page. + +| Key Type | Support | Remarks | +|:---------:|:-------:|:-------:| +| `Ed25519` | ✘ | | +| `Ed448` | ✘ | | +| `X25519` | ✘ | | +| `X448` | ✘ | | + ## JSON Web Signature (JWS) JWS is defined in [RFC 7515](https://tools.ietf.org/html/rfc7515). diff --git a/src/jwk.rs b/src/jwk.rs index 3ec32631..48b2fa81 100644 --- a/src/jwk.rs +++ b/src/jwk.rs @@ -22,6 +22,9 @@ pub enum KeyType { /// Octet sequence, representing symmetric keys #[serde(rename = "oct")] Octect, + /// Octet string key pairs + #[serde(rename = "OKP")] + OctectKeyPair, } impl KeyType { @@ -31,6 +34,7 @@ impl KeyType { KeyType::EllipticCurve => "Elliptic curve (EC) key", KeyType::RSA => "RSA Key", KeyType::Octect => "Key byte sequence", + KeyType::OctectKeyPair => "Octet string key pairs", } } }