diff --git a/pgp-cert-d-java/src/main/java/pgp/cert_d/SharedPGPCertificateDirectoryImpl.java b/pgp-cert-d-java/src/main/java/pgp/cert_d/SharedPGPCertificateDirectoryImpl.java index 096f1b5..c46d1f6 100644 --- a/pgp-cert-d-java/src/main/java/pgp/cert_d/SharedPGPCertificateDirectoryImpl.java +++ b/pgp-cert-d-java/src/main/java/pgp/cert_d/SharedPGPCertificateDirectoryImpl.java @@ -97,7 +97,7 @@ public class SharedPGPCertificateDirectoryImpl implements SharedPGPCertificateDi @Override public Certificate getBySpecialName(String specialName) - throws IOException, BadNameException { + throws IOException, BadNameException, BadDataException { File certFile = resolver.getCertFileBySpecialName(specialName); if (!certFile.exists()) { return null; @@ -122,7 +122,7 @@ public class SharedPGPCertificateDirectoryImpl implements SharedPGPCertificateDi @Override public Certificate getBySpecialNameIfChanged(String specialName, String tag) - throws IOException, BadNameException { + throws IOException, BadNameException, BadDataException { Certificate certificate = getBySpecialName(specialName); if (certificate.getTag().equals(tag)) { return null; diff --git a/pgp-certificate-store/src/main/java/pgp/certificate_store/CertificateReaderBackend.java b/pgp-certificate-store/src/main/java/pgp/certificate_store/CertificateReaderBackend.java index c16b111..b3060f5 100644 --- a/pgp-certificate-store/src/main/java/pgp/certificate_store/CertificateReaderBackend.java +++ b/pgp-certificate-store/src/main/java/pgp/certificate_store/CertificateReaderBackend.java @@ -4,6 +4,8 @@ package pgp.certificate_store; +import pgp.certificate_store.exception.BadDataException; + import java.io.IOException; import java.io.InputStream; @@ -20,7 +22,8 @@ public interface CertificateReaderBackend { * @return certificate object * * @throws IOException in case of an IO error + * @throws BadDataException in case that the input stream does not contain OpenPGP certificate data */ - Certificate readCertificate(InputStream inputStream) throws IOException; + Certificate readCertificate(InputStream inputStream) throws IOException, BadDataException; }