mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-22 12:22:06 +01:00
parent
a9cec16dc6
commit
265f72d99f
2 changed files with 19 additions and 3 deletions
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
package org.pgpainless.sop;
|
package org.pgpainless.sop;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -98,10 +97,10 @@ public class DetachedSignImpl implements DetachedSign {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
|
OutputStream sink = new NullOutputStream();
|
||||||
try {
|
try {
|
||||||
EncryptionStream signingStream = PGPainless.encryptAndOrSign()
|
EncryptionStream signingStream = PGPainless.encryptAndOrSign()
|
||||||
.onOutputStream(buffer)
|
.onOutputStream(sink)
|
||||||
.withOptions(ProducerOptions.sign(signingOptions)
|
.withOptions(ProducerOptions.sign(signingOptions)
|
||||||
.setAsciiArmor(armor));
|
.setAsciiArmor(armor));
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
// SPDX-FileCopyrightText: 2024 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package org.pgpainless.sop;
|
||||||
|
|
||||||
|
import java.io.OutputStream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link OutputStream} that simply discards bytes written to it.
|
||||||
|
*/
|
||||||
|
public class NullOutputStream extends OutputStream {
|
||||||
|
@Override
|
||||||
|
public void write(int b) {
|
||||||
|
// NOP
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue