2022-01-11 13:46:05 +01:00
|
|
|
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
package sop.operation;
|
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import sop.Verification;
|
|
|
|
import sop.exception.SOPGPException;
|
|
|
|
|
|
|
|
public interface VerifySignatures {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provide the signed data (without signatures).
|
|
|
|
*
|
|
|
|
* @param data signed data
|
|
|
|
* @return list of signature verifications
|
|
|
|
* @throws IOException in case of an IO error
|
2022-06-10 16:16:37 +02:00
|
|
|
* @throws SOPGPException.NoSignature when no valid signature is found
|
2022-01-11 13:46:05 +01:00
|
|
|
* @throws SOPGPException.BadData when the data is invalid OpenPGP data
|
|
|
|
*/
|
2022-06-10 16:16:37 +02:00
|
|
|
List<Verification> data(InputStream data)
|
|
|
|
throws IOException,
|
|
|
|
SOPGPException.NoSignature,
|
|
|
|
SOPGPException.BadData;
|
2022-01-11 13:46:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Provide the signed data (without signatures).
|
|
|
|
*
|
|
|
|
* @param data signed data
|
|
|
|
* @return list of signature verifications
|
|
|
|
* @throws IOException in case of an IO error
|
2022-06-10 16:16:37 +02:00
|
|
|
* @throws SOPGPException.NoSignature when no valid signature is found
|
2022-01-11 13:46:05 +01:00
|
|
|
* @throws SOPGPException.BadData when the data is invalid OpenPGP data
|
|
|
|
*/
|
2022-06-10 16:16:37 +02:00
|
|
|
default List<Verification> data(byte[] data)
|
|
|
|
throws IOException,
|
|
|
|
SOPGPException.NoSignature,
|
|
|
|
SOPGPException.BadData {
|
2022-01-11 13:46:05 +01:00
|
|
|
return data(new ByteArrayInputStream(data));
|
|
|
|
}
|
|
|
|
}
|