1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-16 08:34:53 +02:00
pgpainless/sop-java/src/main/java/sop/operation/DetachInbandSignatureAndMessage.java

42 lines
1.2 KiB
Java
Raw Normal View History

2021-10-07 15:48:52 +02: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 sop.ReadyWithResult;
import sop.Signatures;
public interface DetachInbandSignatureAndMessage {
/**
* Do not wrap the signatures in ASCII armor.
* @return builder
*/
DetachInbandSignatureAndMessage noArmor();
/**
* Detach the provided cleartext signed message from its signatures.
*
* @param messageInputStream input stream containing the signed message
* @return result containing the detached message
* @throws IOException in case of an IO error
*/
ReadyWithResult<Signatures> message(InputStream messageInputStream) throws IOException;
/**
* Detach the provided cleartext signed message from its signatures.
*
* @param message byte array containing the signed message
* @return result containing the detached message
* @throws IOException in case of an IO error
*/
default ReadyWithResult<Signatures> message(byte[] message) throws IOException {
return message(new ByteArrayInputStream(message));
}
}