Skip to content

Commit

Permalink
Add a Signable::sign function for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
g2p authored and lawliet89 committed Feb 2, 2021
1 parent 499c640 commit e9f7d0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/jws/flattened.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ impl Signable {
})
}

/// Convenience function to build a SignedData from this Signable
/// See [`SignedData::sign`]
pub fn sign(self, secret: Secret) -> Result<SignedData, Error> {
SignedData::sign(self, secret)
}

/// JWS Signing Input
fn signing_input(&self) -> Vec<u8> {
signing_input(&self.protected_header_serialized, &self.payload)
Expand Down

0 comments on commit e9f7d0f

Please sign in to comment.