sop.operation.VerifySignatures.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sop-java Show documentation
Show all versions of sop-java Show documentation
Stateless OpenPGP Protocol API for Java
// SPDX-FileCopyrightText: 2023 Paul Schaub
//
// SPDX-License-Identifier: Apache-2.0
package sop.operation
import java.io.IOException
import java.io.InputStream
import sop.Verification
import sop.exception.SOPGPException.BadData
import sop.exception.SOPGPException.NoSignature
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
* @throws NoSignature when no valid signature is found
* @throws BadData when the data is invalid OpenPGP data
*/
@Throws(IOException::class, NoSignature::class, BadData::class)
fun data(data: InputStream): List
/**
* Provide the signed data (without signatures).
*
* @param data signed data
* @return list of signature verifications
* @throws IOException in case of an IO error
* @throws NoSignature when no valid signature is found
* @throws BadData when the data is invalid OpenPGP data
*/
@Throws(IOException::class, NoSignature::class, BadData::class)
fun data(data: ByteArray): List = data(data.inputStream())
}