2022-03-01 15:19:01 +01:00
|
|
|
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package pgp.certificate_store;
|
|
|
|
|
2022-07-04 19:40:26 +02:00
|
|
|
import pgp.certificate_store.exception.BadDataException;
|
|
|
|
|
2022-03-01 15:19:01 +01:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface definition for a class that can read {@link Certificate Certificates} from binary
|
|
|
|
* {@link InputStream InputStreams}.
|
|
|
|
*/
|
|
|
|
public interface CertificateReaderBackend {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read a {@link Certificate} from the given {@link InputStream}.
|
|
|
|
*
|
|
|
|
* @param inputStream input stream containing the binary representation of the certificate.
|
|
|
|
* @return certificate object
|
|
|
|
*
|
|
|
|
* @throws IOException in case of an IO error
|
2022-07-04 19:40:26 +02:00
|
|
|
* @throws BadDataException in case that the input stream does not contain OpenPGP certificate data
|
2022-03-01 15:19:01 +01:00
|
|
|
*/
|
2022-07-04 19:40:26 +02:00
|
|
|
Certificate readCertificate(InputStream inputStream) throws IOException, BadDataException;
|
2022-03-01 15:19:01 +01:00
|
|
|
|
|
|
|
}
|