Better handle a non-existant cert directory
Consider:
fn main() {
sequoia_cert_store::CertStore::new().unwrap();
}
If the directory does not exist, this fails:
$ PGP_CERT_D=/tmp/non-existant cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s
Running `target/debug/cert-test`
thread 'main' panicked at src/main.rs:2:42:
can open: unable to open database file: /tmp/non-existant/_sequoia_cert_store_index_v1_on_alice.sqlite
Caused by:
Error code 14: Unable to open the database file
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This is quite annoying, because the caller doesn't know what directory needs to be created (this detail is hidden by CertStore::new).
If the directory does not exist, I think that we should create it. If we can't create it, we should still not fail for read-only operations, but treat the certificate store as being empty.