Skip to content

Commit

Permalink
Provide the ability to specify the header x5c
Browse files Browse the repository at this point in the history
Signed-off-by: David Mulder <[email protected]>
  • Loading branch information
dmulder committed Dec 13, 2023
1 parent d9875de commit fdc4f5d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/jws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ impl JwsBuilder {
self
}

/// Set the chain of certificates
pub fn set_x5c(mut self, x5c: Option<Vec<Vec<u8>>>) -> Self {
self.header.x5c = x5c.map(|v| {
v.into_iter()
.map(|c| general_purpose::STANDARD.encode(c))
.collect()
});
self
}

/// Finalise this builder
pub fn build(self) -> Jws {
let JwsBuilder { header, payload } = self;
Expand Down

0 comments on commit fdc4f5d

Please sign in to comment.