Skip to content
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

JWS: Protected vs. Unprotected #26

Open
tgross35 opened this issue Apr 16, 2023 · 1 comment
Open

JWS: Protected vs. Unprotected #26

tgross35 opened this issue Apr 16, 2023 · 1 comment

Comments

@tgross35
Copy link
Contributor

Currently, Unprotected has https://www.rfc-editor.org/rfc/rfc7515#section-4.1 claims, and Protected just wraps these claims.

pub struct Protected {
    pub crit: Option<Vec<String>>,
    pub nonce: Option<Bytes>,
    pub b64: bool,
    pub oth: Unprotected,
}

pub struct Unprotected {
    pub alg: Option<Signing>,
    pub jwk: Option<Jwk>,
    pub kid: Option<String>,
    pub x5c: Option<Vec<Bytes<Box<[u8]>, Base64>>>,
    pub x5t: Thumbprint,
    pub typ: Option<String>,
    pub cty: Option<String>,
}

I think the naming is somewhat confusing, at least to my understanding since Unprotected data may be protected. Maybe it would be better to move the Unprotected contents to a Common struct and reference it from both Protected and Unprotected?

Also not sure how this should interact with JWEs since they have the same headers. Would jose_alg be better named jose_common or something like that?

@tgross35 tgross35 mentioned this issue Apr 16, 2023
23 tasks
@tgross35
Copy link
Contributor Author

I actually think biscuit does a nice job here https://docs.rs/biscuit/latest/biscuit/jws/index.html but their structure is pretty different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant