2022-08-09 17:50:15 +02:00
|
|
|
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package pgp.cert_d;
|
|
|
|
|
2022-08-09 18:00:27 +02:00
|
|
|
import pgp.certificate.KeyMaterialReaderBackend;
|
2022-08-09 17:50:15 +02:00
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
public final class PGPCertificateDirectories {
|
|
|
|
|
|
|
|
private PGPCertificateDirectories() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public static PGPCertificateDirectory inMemoryCertificateDirectory(KeyMaterialReaderBackend keyReader) {
|
|
|
|
return new PGPCertificateDirectory(new InMemoryCertificateDirectoryBackend(keyReader));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static PGPCertificateDirectory defaultFileBasedCertificateDirectory(KeyMaterialReaderBackend keyReader)
|
|
|
|
throws NotAStoreException {
|
|
|
|
return fileBasedCertificateDirectory(keyReader, BaseDirectoryProvider.getDefaultBaseDir());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static PGPCertificateDirectory fileBasedCertificateDirectory(
|
|
|
|
KeyMaterialReaderBackend keyReader, File baseDirectory)
|
|
|
|
throws NotAStoreException {
|
|
|
|
return new PGPCertificateDirectory(
|
|
|
|
new FileBasedCertificateDirectoryBackend(baseDirectory, keyReader));
|
|
|
|
}
|
|
|
|
}
|