Skip to content

Commit

Permalink
sign: make to-be-signed function publicly for async signing (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh authored Jul 11, 2024
1 parent 4c73b12 commit 50583c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sign/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl CoseSign {
}

/// Construct the to-be-signed data for this object.
fn tbs_data(&self, aad: &[u8], sig: &CoseSignature) -> Vec<u8> {
pub fn tbs_data(&self, aad: &[u8], sig: &CoseSignature) -> Vec<u8> {
sig_structure_data(
SignatureContext::CoseSignature,
self.protected.clone(),
Expand All @@ -196,7 +196,7 @@ impl CoseSign {
/// # Panics
///
/// This method will panic if `self.payload.is_some()`.
fn tbs_detached_data(&self, payload: &[u8], aad: &[u8], sig: &CoseSignature) -> Vec<u8> {
pub fn tbs_detached_data(&self, payload: &[u8], aad: &[u8], sig: &CoseSignature) -> Vec<u8> {
assert!(self.payload.is_none());
sig_structure_data(
SignatureContext::CoseSignature,
Expand Down Expand Up @@ -387,7 +387,7 @@ impl CoseSign1 {
}

/// Construct the to-be-signed data for this object.
fn tbs_data(&self, aad: &[u8]) -> Vec<u8> {
pub fn tbs_data(&self, aad: &[u8]) -> Vec<u8> {
sig_structure_data(
SignatureContext::CoseSign1,
self.protected.clone(),
Expand All @@ -402,7 +402,7 @@ impl CoseSign1 {
/// # Panics
///
/// This method will panic if `self.payload.is_some()`.
fn tbs_detached_data(&self, payload: &[u8], aad: &[u8]) -> Vec<u8> {
pub fn tbs_detached_data(&self, payload: &[u8], aad: &[u8]) -> Vec<u8> {
assert!(self.payload.is_none());
sig_structure_data(
SignatureContext::CoseSign1,
Expand Down

0 comments on commit 50583c5

Please sign in to comment.