13 lines
581 B
Markdown
13 lines
581 B
Markdown
|
|
# Phase 5
|
||
|
|
|
||
|
|
For phase 5, implement the `open` command. This will provide an implementation for the `perform_open` method, and will
|
||
|
|
also need another couple error variants, unless they already exist:
|
||
|
|
|
||
|
|
- The given key might not open the given drawer file
|
||
|
|
- The drawer file might not decrypt to a valid tarball
|
||
|
|
|
||
|
|
The code for the open command is pretty much the same as the close command, in reverse order:
|
||
|
|
|
||
|
|
- Read the drawer file into an array
|
||
|
|
- Decrypt it with the key (failing if it won't decrypt, or if it's not a valid tarball)
|
||
|
|
- Expand it with the `tar` crate into the target path
|