@@ -15,7 +15,7 @@ use std::str::FromStr;
15
15
/// The `note` field stores this data,
16
16
/// and its authenticity can be verified with the data in `signature`.
17
17
#[ derive( Debug , PartialEq , Clone , Eq ) ]
18
- pub struct SignedCheckpoint {
18
+ pub struct Checkpoint {
19
19
pub note : CheckpointNote ,
20
20
pub signature : CheckpointSignature ,
21
21
}
@@ -67,7 +67,7 @@ pub enum ParseCheckpointError {
67
67
DecodeError ( String ) ,
68
68
}
69
69
70
- impl FromStr for SignedCheckpoint {
70
+ impl FromStr for Checkpoint {
71
71
type Err = ParseCheckpointError ;
72
72
73
73
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
@@ -82,7 +82,7 @@ impl FromStr for SignedCheckpoint {
82
82
let signature = signature. parse ( ) ?;
83
83
let note = CheckpointNote :: unmarshal ( note) ?;
84
84
85
- Ok ( SignedCheckpoint { note, signature } )
85
+ Ok ( Checkpoint { note, signature } )
86
86
}
87
87
}
88
88
@@ -139,15 +139,15 @@ impl CheckpointNote {
139
139
}
140
140
}
141
141
142
- impl ToString for SignedCheckpoint {
142
+ impl ToString for Checkpoint {
143
143
fn to_string ( & self ) -> String {
144
144
let note = self . note . marshal ( ) ;
145
145
let signature = self . signature . to_string ( ) ;
146
146
format ! ( "{note}\n {signature}" )
147
147
}
148
148
}
149
149
150
- impl SignedCheckpoint {
150
+ impl Checkpoint {
151
151
/// This method can be used to verify that the checkpoint was issued by the log with the
152
152
/// public key `rekor_key`.
153
153
pub fn verify_signature ( & self , rekor_key : & CosignVerificationKey ) -> Result < ( ) , SigstoreError > {
@@ -175,7 +175,7 @@ impl SignedCheckpoint {
175
175
}
176
176
}
177
177
178
- impl Serialize for SignedCheckpoint {
178
+ impl Serialize for Checkpoint {
179
179
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
180
180
where
181
181
S : Serializer ,
@@ -184,13 +184,13 @@ impl Serialize for SignedCheckpoint {
184
184
}
185
185
}
186
186
187
- impl < ' de > Deserialize < ' de > for SignedCheckpoint {
187
+ impl < ' de > Deserialize < ' de > for Checkpoint {
188
188
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
189
189
where
190
190
D : Deserializer < ' de > ,
191
191
{
192
192
<String >:: deserialize ( deserializer) . and_then ( |s| {
193
- SignedCheckpoint :: from_str ( & s) . map_err ( |DecodeError ( err) | serde:: de:: Error :: custom ( err) )
193
+ Checkpoint :: from_str ( & s) . map_err ( |DecodeError ( err) | serde:: de:: Error :: custom ( err) )
194
194
} )
195
195
}
196
196
}
0 commit comments