@@ -88,39 +88,6 @@ impl<'de> Deserialize<'de> for HashAlgorithm {
8888 }
8989}
9090
91- /// A hash output with its algorithm
92- /// TODO: This is unused?
93- #[ derive( Debug , Clone , PartialEq , Eq ) ]
94- pub struct HashOutput {
95- /// The algorithm used to produce this hash
96- pub algorithm : HashAlgorithm ,
97- /// The hash digest bytes
98- pub digest : Vec < u8 > ,
99- }
100-
101- impl HashOutput {
102- /// Create a new hash output
103- pub fn new ( algorithm : HashAlgorithm , digest : Vec < u8 > ) -> Self {
104- Self { algorithm, digest }
105- }
106-
107- /// Get the digest as a hex string
108- pub fn to_hex ( & self ) -> String {
109- self . digest . iter ( ) . map ( |b| format ! ( "{:02x}" , b) ) . collect ( )
110- }
111- }
112-
113- /// Message imprint combining algorithm and digest (for TSA)
114- #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
115- #[ serde( rename_all = "camelCase" ) ]
116- pub struct MessageImprint {
117- /// Hash algorithm used
118- pub algorithm : HashAlgorithm ,
119- /// Hash digest (base64 encoded in JSON)
120- #[ serde( with = "crate::encoding::base64_bytes" ) ]
121- pub digest : Vec < u8 > ,
122- }
123-
12491// Re-export base64_bytes from encoding module for backwards compatibility
12592pub use crate :: encoding:: base64_bytes;
12693
0 commit comments