-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes to support ACME, including JWS #359
base: master
Are you sure you want to change the base?
Changes from 1 commit
fd60bf2
b6ef547
7904bb1
b0072fd
5a3b07f
c64cbe2
dbc9dbd
f2f070b
a1cf7b7
8ae98dc
dd34b25
b8cf8b2
f7b51d2
0cfda16
d61c791
4f57bea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,16 @@ pub struct Header { | |
#[serde(skip_serializing_if = "Option::is_none")] | ||
#[serde(rename = "x5t#S256")] | ||
pub x5t_s256: Option<String>, | ||
/// ACME: The URL to which this JWS object is directed | ||
/// | ||
/// Defined in [RFC8555#6.4](https://datatracker.ietf.org/doc/html/rfc8555#section-6.4). | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub url: Option<String>, | ||
/// ACME: Random data for preventing replay attacks. | ||
/// | ||
/// Defined in [RFC8555#6.5.2](https://datatracker.ietf.org/doc/html/rfc8555#section-6.5.2). | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub nonce: Option<String>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add #347 (comment) while you're there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added crit, enc, and zip -- I think I have the values there right, but I'm not familiar with their use so double checking it would probably be good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. @inferiorhumanorgans can you have a look? |
||
} | ||
|
||
impl Header { | ||
|
@@ -80,6 +90,8 @@ impl Header { | |
x5c: None, | ||
x5t: None, | ||
x5t_s256: None, | ||
url: None, | ||
nonce: None, | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//! JSON Web Signatures data type. | ||
use std::marker::PhantomData; | ||
|
||
use serde::{Deserialize, Serialize}; | ||
|
||
/// This is a serde-compatible JSON Web Signature structure. | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub struct Jws<C> { | ||
/// The base64 encoded header data. | ||
/// | ||
/// Defined in [RFC7515#3.2](https://tools.ietf.org/html/rfc7515#section-3.2). | ||
pub protected: String, | ||
/// The base64 encoded claims data. | ||
/// | ||
/// Defined in [RFC7515#3.2](https://tools.ietf.org/html/rfc7515#section-3.2). | ||
pub payload: String, | ||
/// The signature on the other fields. | ||
/// | ||
/// Defined in [RFC7515#3.2](https://tools.ietf.org/html/rfc7515#section-3.2). | ||
pub signature: String, | ||
/// Unused, for associating type metadata. | ||
#[serde(skip)] | ||
pub _pd: PhantomData<C>, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably macro it out to avoid duplicating the code from
verify_signature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried factoring out a function, let me know if this works for you.