mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-03-14 03:13:28 +01:00
Replace ByteArrayInputStream with inputStream()
This commit is contained in:
parent
8df4a520bd
commit
9283f81c56
3 changed files with 5 additions and 9 deletions
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
package sop.operation
|
package sop.operation
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import sop.exception.SOPGPException.BadData
|
import sop.exception.SOPGPException.BadData
|
||||||
|
@ -31,6 +30,5 @@ interface DetachedVerify : AbstractVerify<DetachedVerify>, VerifySignatures {
|
||||||
* @throws IOException in case of an IO error
|
* @throws IOException in case of an IO error
|
||||||
*/
|
*/
|
||||||
@Throws(BadData::class, IOException::class)
|
@Throws(BadData::class, IOException::class)
|
||||||
fun signatures(signatures: ByteArray): VerifySignatures =
|
fun signatures(signatures: ByteArray): VerifySignatures = signatures(signatures.inputStream())
|
||||||
signatures(ByteArrayInputStream(signatures))
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
package sop.operation
|
package sop.operation
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import sop.Profile
|
import sop.Profile
|
||||||
|
@ -57,7 +56,7 @@ interface Encrypt {
|
||||||
*/
|
*/
|
||||||
@Throws(
|
@Throws(
|
||||||
KeyCannotSign::class, UnsupportedAsymmetricAlgo::class, BadData::class, IOException::class)
|
KeyCannotSign::class, UnsupportedAsymmetricAlgo::class, BadData::class, IOException::class)
|
||||||
fun signWith(key: ByteArray): Encrypt = signWith(ByteArrayInputStream(key))
|
fun signWith(key: ByteArray): Encrypt = signWith(key.inputStream())
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide the password for the secret key used for signing.
|
* Provide the password for the secret key used for signing.
|
||||||
|
@ -125,7 +124,7 @@ interface Encrypt {
|
||||||
UnsupportedAsymmetricAlgo::class,
|
UnsupportedAsymmetricAlgo::class,
|
||||||
BadData::class,
|
BadData::class,
|
||||||
IOException::class)
|
IOException::class)
|
||||||
fun withCert(cert: ByteArray): Encrypt = withCert(ByteArrayInputStream(cert))
|
fun withCert(cert: ByteArray): Encrypt = withCert(cert.inputStream())
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass in a profile.
|
* Pass in a profile.
|
||||||
|
@ -162,5 +161,5 @@ interface Encrypt {
|
||||||
* @throws KeyIsProtected if at least one signing key cannot be unlocked
|
* @throws KeyIsProtected if at least one signing key cannot be unlocked
|
||||||
*/
|
*/
|
||||||
@Throws(IOException::class, KeyIsProtected::class)
|
@Throws(IOException::class, KeyIsProtected::class)
|
||||||
fun plaintext(plaintext: ByteArray): Ready = plaintext(ByteArrayInputStream(plaintext))
|
fun plaintext(plaintext: ByteArray): Ready = plaintext(plaintext.inputStream())
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
package sop.operation
|
package sop.operation
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream
|
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import sop.Ready
|
import sop.Ready
|
||||||
|
@ -38,5 +37,5 @@ interface ExtractCert {
|
||||||
* @throws BadData if the byte array does not contain an OpenPGP key
|
* @throws BadData if the byte array does not contain an OpenPGP key
|
||||||
*/
|
*/
|
||||||
@Throws(IOException::class, BadData::class)
|
@Throws(IOException::class, BadData::class)
|
||||||
fun key(key: ByteArray): Ready = key(ByteArrayInputStream(key))
|
fun key(key: ByteArray): Ready = key(key.inputStream())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue