mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-11 03:09:41 +02:00
Replace static decryptAndOrVerify() method with non-static processMessage() function
This commit is contained in:
parent
7062681d03
commit
9ed53308c6
53 changed files with 141 additions and 129 deletions
|
@ -39,9 +39,7 @@ class DecryptImpl(private val api: PGPainless) : Decrypt {
|
|||
|
||||
val decryptionStream =
|
||||
try {
|
||||
PGPainless.decryptAndOrVerify()
|
||||
.onInputStream(ciphertext)
|
||||
.withOptions(consumerOptions)
|
||||
api.processMessage().onInputStream(ciphertext).withOptions(consumerOptions)
|
||||
} catch (e: MissingDecryptionMethodException) {
|
||||
throw SOPGPException.CannotDecrypt(
|
||||
"No usable decryption key or password provided.", e)
|
||||
|
|
|
@ -28,8 +28,7 @@ class DetachedVerifyImpl(private val api: PGPainless) : DetachedVerify {
|
|||
|
||||
override fun data(data: InputStream): List<Verification> {
|
||||
try {
|
||||
val verificationStream =
|
||||
PGPainless.decryptAndOrVerify().onInputStream(data).withOptions(options)
|
||||
val verificationStream = api.processMessage().onInputStream(data).withOptions(options)
|
||||
|
||||
Streams.drain(verificationStream)
|
||||
verificationStream.close()
|
||||
|
|
|
@ -32,7 +32,7 @@ class InlineVerifyImpl(private val api: PGPainless) : InlineVerify {
|
|||
override fun writeTo(outputStream: OutputStream): List<Verification> {
|
||||
try {
|
||||
val verificationStream =
|
||||
PGPainless.decryptAndOrVerify().onInputStream(data).withOptions(options)
|
||||
api.processMessage().onInputStream(data).withOptions(options)
|
||||
|
||||
Streams.pipeAll(verificationStream, outputStream)
|
||||
verificationStream.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue