2018-06-06 18:46:41 +02:00
|
|
|
package de.vanitasvitae.crypto.pgpainless.decryption_verification;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.util.Set;
|
|
|
|
|
2018-06-07 18:12:13 +02:00
|
|
|
import de.vanitasvitae.crypto.pgpainless.key.SecretKeyRingProtector;
|
2018-06-06 18:46:41 +02:00
|
|
|
import org.bouncycastle.openpgp.PGPException;
|
|
|
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
|
|
|
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
|
|
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
|
|
|
|
|
|
|
public interface DecryptionBuilderInterface {
|
|
|
|
|
|
|
|
DecryptWith onInputStream(InputStream inputStream);
|
|
|
|
|
|
|
|
interface DecryptWith {
|
|
|
|
|
2018-06-07 18:12:13 +02:00
|
|
|
VerifyWith decryptWith(PGPSecretKeyRingCollection secretKeyRings, SecretKeyRingProtector decryptor);
|
2018-06-06 18:46:41 +02:00
|
|
|
|
|
|
|
VerifyWith doNotDecrypt();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
interface VerifyWith {
|
|
|
|
|
|
|
|
MissingPublicKeyFeedback verifyWith(Set<Long> trustedFingerprints, PGPPublicKeyRingCollection publicKeyRings);
|
|
|
|
|
|
|
|
MissingPublicKeyFeedback verifyWith(Set<Long> trustedFingerprints, Set<PGPPublicKeyRing> publicKeyRings);
|
|
|
|
|
|
|
|
Build doNotVerify();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
interface MissingPublicKeyFeedback {
|
|
|
|
|
|
|
|
Build handleMissingPublicKeysWith(MissingPublicKeyCallback callback);
|
|
|
|
|
|
|
|
Build ignoreMissingPublicKeys();
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Build {
|
|
|
|
|
2018-06-11 01:33:49 +02:00
|
|
|
DecryptionStream build() throws IOException, PGPException;
|
2018-06-06 18:46:41 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|