001// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
002//
003// SPDX-License-Identifier: Apache-2.0
004
005package org.pgpainless.decryption_verification.cleartext_signatures;
006
007import java.io.IOException;
008import java.io.InputStream;
009
010import org.pgpainless.decryption_verification.ConsumerOptions;
011
012/**
013 * Interface defining the API for verification of cleartext signed documents.
014 */
015public interface VerifyCleartextSignatures {
016
017    /**
018     * Provide the {@link InputStream} which contains the cleartext-signed message.
019     * @param inputStream inputstream
020     * @return api handle
021     */
022    VerifyWith onInputStream(InputStream inputStream);
023
024    interface VerifyWith {
025
026        /**
027         * Pass in consumer options like verification certificates, acceptable date ranges etc.
028         *
029         * @param options options
030         * @return processor
031         * @throws IOException in case of an IO error
032         */
033        CleartextSignatureProcessor withOptions(ConsumerOptions options) throws IOException;
034
035    }
036}