68 lines
1.9 KiB
Java
68 lines
1.9 KiB
Java
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package sop.operation;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.InputStream;
|
|
import java.util.Date;
|
|
|
|
import sop.exception.SOPGPException;
|
|
|
|
public interface Verify extends VerifySignatures {
|
|
|
|
/**
|
|
* Makes the SOP implementation consider signatures before this date invalid.
|
|
*
|
|
* @param timestamp timestamp
|
|
* @return builder instance
|
|
*/
|
|
Verify notBefore(Date timestamp) throws SOPGPException.UnsupportedOption;
|
|
|
|
/**
|
|
* Makes the SOP implementation consider signatures after this date invalid.
|
|
*
|
|
* @param timestamp timestamp
|
|
* @return builder instance
|
|
*/
|
|
Verify notAfter(Date timestamp) throws SOPGPException.UnsupportedOption;
|
|
|
|
/**
|
|
* Add one or more verification cert.
|
|
*
|
|
* @param cert input stream containing the encoded certs
|
|
* @return builder instance
|
|
*/
|
|
Verify cert(InputStream cert) throws SOPGPException.BadData;
|
|
|
|
/**
|
|
* Add one or more verification cert.
|
|
*
|
|
* @param cert byte array containing the encoded certs
|
|
* @return builder instance
|
|
*/
|
|
default Verify cert(byte[] cert) throws SOPGPException.BadData {
|
|
return cert(new ByteArrayInputStream(cert));
|
|
}
|
|
|
|
/**
|
|
* Provides the signatures.
|
|
* @param signatures input stream containing encoded, detached signatures.
|
|
*
|
|
* @return builder instance
|
|
*/
|
|
VerifySignatures signatures(InputStream signatures) throws SOPGPException.BadData;
|
|
|
|
/**
|
|
* Provides the signatures.
|
|
* @param signatures byte array containing encoded, detached signatures.
|
|
*
|
|
* @return builder instance
|
|
*/
|
|
default VerifySignatures signatures(byte[] signatures) throws SOPGPException.BadData {
|
|
return signatures(new ByteArrayInputStream(signatures));
|
|
}
|
|
|
|
}
|