From 50583c5df52b653eb9b17c2940ad4b7fe3d67ff1 Mon Sep 17 00:00:00 2001 From: 0xZensh Date: Fri, 12 Jul 2024 01:51:05 +0800 Subject: [PATCH] sign: make to-be-signed function publicly for async signing (#95) --- src/sign/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sign/mod.rs b/src/sign/mod.rs index 9abc6a4..141df2a 100644 --- a/src/sign/mod.rs +++ b/src/sign/mod.rs @@ -181,7 +181,7 @@ impl CoseSign { } /// Construct the to-be-signed data for this object. - fn tbs_data(&self, aad: &[u8], sig: &CoseSignature) -> Vec { + pub fn tbs_data(&self, aad: &[u8], sig: &CoseSignature) -> Vec { sig_structure_data( SignatureContext::CoseSignature, self.protected.clone(), @@ -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 { + pub fn tbs_detached_data(&self, payload: &[u8], aad: &[u8], sig: &CoseSignature) -> Vec { assert!(self.payload.is_none()); sig_structure_data( SignatureContext::CoseSignature, @@ -387,7 +387,7 @@ impl CoseSign1 { } /// Construct the to-be-signed data for this object. - fn tbs_data(&self, aad: &[u8]) -> Vec { + pub fn tbs_data(&self, aad: &[u8]) -> Vec { sig_structure_data( SignatureContext::CoseSign1, self.protected.clone(), @@ -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 { + pub fn tbs_detached_data(&self, payload: &[u8], aad: &[u8]) -> Vec { assert!(self.payload.is_none()); sig_structure_data( SignatureContext::CoseSign1,