2021-10-07 15:48:52 +02:00
|
|
|
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2021-07-15 16:55:13 +02:00
|
|
|
package sop.operation;
|
2021-01-18 18:31:50 +01:00
|
|
|
|
2021-10-10 16:34:17 +02:00
|
|
|
import java.io.ByteArrayInputStream;
|
2021-07-15 16:55:13 +02:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
2021-01-18 18:31:50 +01:00
|
|
|
|
2021-07-15 16:55:13 +02:00
|
|
|
import sop.Ready;
|
|
|
|
import sop.exception.SOPGPException;
|
2021-01-18 18:31:50 +01:00
|
|
|
|
2021-07-15 16:55:13 +02:00
|
|
|
public interface Dearmor {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dearmor armored OpenPGP data.
|
|
|
|
*
|
|
|
|
* @param data armored OpenPGP data
|
|
|
|
* @return input stream of unarmored data
|
|
|
|
*/
|
|
|
|
Ready data(InputStream data) throws SOPGPException.BadData, IOException;
|
2021-10-10 16:34:17 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Dearmor armored OpenPGP data.
|
|
|
|
*
|
|
|
|
* @param data armored OpenPGP data
|
|
|
|
* @return input stream of unarmored data
|
|
|
|
*/
|
|
|
|
default Ready data(byte[] data) throws SOPGPException.BadData, IOException {
|
|
|
|
return data(new ByteArrayInputStream(data));
|
|
|
|
}
|
2021-01-18 18:31:50 +01:00
|
|
|
}
|