mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-09 13:51:10 +01:00
Checkstyle issues
This commit is contained in:
parent
1b1ebc3f43
commit
24a251fbc2
5 changed files with 51 additions and 50 deletions
|
|
@ -5,6 +5,7 @@
|
|||
package org.pgpainless.sop
|
||||
|
||||
import java.io.BufferedOutputStream
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import kotlin.jvm.Throws
|
||||
|
|
@ -15,7 +16,6 @@ import org.pgpainless.util.ArmoredOutputStreamFactory
|
|||
import sop.Ready
|
||||
import sop.exception.SOPGPException
|
||||
import sop.operation.Armor
|
||||
import java.io.IOException
|
||||
|
||||
/** Implementation of the `armor` operation using PGPainless. */
|
||||
class ArmorImpl(private val api: PGPainless) : Armor {
|
||||
|
|
@ -28,13 +28,13 @@ class ArmorImpl(private val api: PGPainless) : Armor {
|
|||
val bufferedOutputStream = BufferedOutputStream(outputStream)
|
||||
|
||||
// Determine the nature of the given data
|
||||
|
||||
val openPgpIn = OpenPGPAnimalSnifferInputStream(data).apply {
|
||||
try {
|
||||
inspectBuffer()
|
||||
} catch (e: IOException) {
|
||||
// ignore
|
||||
}
|
||||
reset()
|
||||
}
|
||||
|
||||
if (openPgpIn.isAsciiArmored) {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
|
||||
package org.pgpainless.sop
|
||||
|
||||
import org.bouncycastle.bcpg.UnsupportedPacketVersionException
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import java.util.*
|
||||
import java.util.zip.ZipException
|
||||
import kotlin.NoSuchElementException
|
||||
import org.bouncycastle.bcpg.UnsupportedPacketVersionException
|
||||
import org.bouncycastle.openpgp.PGPException
|
||||
import org.bouncycastle.util.io.Streams
|
||||
import org.pgpainless.PGPainless
|
||||
|
|
@ -23,8 +25,6 @@ import sop.ReadyWithResult
|
|||
import sop.SessionKey
|
||||
import sop.exception.SOPGPException
|
||||
import sop.operation.Decrypt
|
||||
import java.util.zip.ZipException
|
||||
import kotlin.NoSuchElementException
|
||||
|
||||
/** Implementation of the `decrypt` operation using PGPainless. */
|
||||
class DecryptImpl(private val api: PGPainless) : Decrypt {
|
||||
|
|
@ -57,8 +57,7 @@ class DecryptImpl(private val api: PGPainless) : Decrypt {
|
|||
throw SOPGPException.BadData(e)
|
||||
} catch (e: ModificationDetectionException) {
|
||||
throw SOPGPException.BadData(e)
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
// Forget passphrases after decryption
|
||||
protector.clear()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue