Skip to content

JWS: Protected vs. Unprotected #26

Open
@tgross35

Description

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions