wkd-java/wkd-java/src/main/java/pgp/wkd/discovery/CertificateParser.java

32 lines
955 B
Java
Raw Normal View History

2022-03-10 16:56:46 +01:00
// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
2022-03-17 15:27:28 +01:00
package pgp.wkd.discovery;
import pgp.wkd.CertificateAndUserIds;
2022-03-10 16:56:46 +01:00
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
2022-04-05 16:11:06 +02:00
/**
* Interface for an OpenPGP certificate parser class.
*/
2022-03-17 15:27:28 +01:00
public interface CertificateParser {
2022-03-10 16:56:46 +01:00
2022-04-05 16:11:06 +02:00
/**
* Read a list of OpenPGP certificates from the given input stream.
* The input stream contains binary OpenPGP certificate data.
*
* The result is a list of {@link CertificateAndUserIds}, where {@link CertificateAndUserIds#getUserIds()} only
* contains validly bound user-ids.
*
* @param inputStream input stream of binary OpenPGP certificates
* @return list of parsed certificates and their user-ids
*
* @throws IOException in case of an IO error
*/
2022-03-10 16:56:46 +01:00
List<CertificateAndUserIds> read(InputStream inputStream) throws IOException;
}