Open
Description
The current representation is as follows:
pub enum Jws {
General(General),
Flattened(Flattened),
}
pub struct General {
pub payload: Option<Bytes>,
pub signatures: Vec<Signature>,
}
pub struct Flattened {
pub payload: Option<Bytes>,
pub signature: Signature,
}
It seems a bit unusual to define general vs. flattened at the top level since it's only relevant for signatures. It seems like maybe something like this would work a bit better:
pub enum Jws {
pub payload: Option<Bytes>,
pub signatures: SomeSignatureEnum,
}
enum SomeSignatureEnum {
Flattened(Signature),
General(Vec<Signature>)
}
And this would at least make it easier to work with payload
without needing to branch on General/Flattened.
Just curious what thoughts are here
Related: #22
Metadata
Assignees
Labels
No labels
Activity