File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ pub enum SSECEncryptionKey {
157
157
}
158
158
159
159
#[ derive( Debug , thiserror:: Error ) ]
160
- pub enum Error {
160
+ pub enum SSEError {
161
161
#[ error( "Expected SSE-C:AES256:<base64_encryption_key>" ) ]
162
162
UnexpectedKey ,
163
163
#[ error( "Only SSE-C is supported for object encryption for now" ) ]
@@ -167,16 +167,16 @@ pub enum Error {
167
167
}
168
168
169
169
impl FromStr for SSECEncryptionKey {
170
- type Err = Error ;
170
+ type Err = SSEError ;
171
171
172
172
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
173
173
let parts = s. split ( ':' ) . collect :: < Vec < _ > > ( ) ;
174
174
if parts. len ( ) != 3 {
175
- return Err ( Error :: UnexpectedKey ) ;
175
+ return Err ( SSEError :: UnexpectedKey ) ;
176
176
}
177
177
let sse_type = parts[ 0 ] ;
178
178
if sse_type != "SSE-C" {
179
- return Err ( Error :: UnexpectedProtocol ) ;
179
+ return Err ( SSEError :: UnexpectedProtocol ) ;
180
180
}
181
181
182
182
let algorithm = parts[ 1 ] ;
@@ -199,12 +199,12 @@ pub enum ObjectEncryptionAlgorithm {
199
199
}
200
200
201
201
impl FromStr for ObjectEncryptionAlgorithm {
202
- type Err = Error ;
202
+ type Err = SSEError ;
203
203
204
204
fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
205
205
match s {
206
206
"AES256" => Ok ( ObjectEncryptionAlgorithm :: Aes256 ) ,
207
- _ => Err ( Error :: InvalidAlgorithm ) ,
207
+ _ => Err ( SSEError :: InvalidAlgorithm ) ,
208
208
}
209
209
}
210
210
}
You can’t perform that action at this time.
0 commit comments