mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-13 20:29:39 +02:00
Cleartext signature framework: Reuse ConsumerOptions
This commit is contained in:
parent
943360aa65
commit
2885ff7a14
4 changed files with 43 additions and 15 deletions
|
@ -77,12 +77,14 @@ public class CleartextSignatureVerificationTest {
|
|||
@Test
|
||||
public void cleartextSignVerification_InMemoryMultiPassStrategy() throws IOException, PGPException {
|
||||
PGPPublicKeyRing signingKeys = TestKeys.getEmilPublicKeyRing();
|
||||
ConsumerOptions options = new ConsumerOptions()
|
||||
.addVerificationCert(signingKeys);
|
||||
|
||||
InMemoryMultiPassStrategy multiPassStrategy = MultiPassStrategy.keepMessageInMemory();
|
||||
CleartextSignatureProcessor processor = PGPainless.verifyCleartextSignedMessage()
|
||||
.onInputStream(new ByteArrayInputStream(MESSAGE_SIGNED))
|
||||
.withStrategy(multiPassStrategy)
|
||||
.verifyWith(signingKeys);
|
||||
.withOptions(options);
|
||||
|
||||
PGPSignature signature = processor.process();
|
||||
|
||||
|
@ -93,6 +95,8 @@ public class CleartextSignatureVerificationTest {
|
|||
@Test
|
||||
public void cleartextSignVerification_FileBasedMultiPassStrategy() throws IOException, PGPException {
|
||||
PGPPublicKeyRing signingKeys = TestKeys.getEmilPublicKeyRing();
|
||||
ConsumerOptions options = new ConsumerOptions()
|
||||
.addVerificationCert(signingKeys);
|
||||
|
||||
File tempDir = TestUtils.createTempDirectory();
|
||||
File file = new File(tempDir, "file");
|
||||
|
@ -100,7 +104,7 @@ public class CleartextSignatureVerificationTest {
|
|||
CleartextSignatureProcessor processor = PGPainless.verifyCleartextSignedMessage()
|
||||
.onInputStream(new ByteArrayInputStream(MESSAGE_SIGNED))
|
||||
.withStrategy(multiPassStrategy)
|
||||
.verifyWith(signingKeys);
|
||||
.withOptions(options);
|
||||
|
||||
PGPSignature signature = processor.process();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue