mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-06-24 12:34:54 +02:00
Compare commits
No commits in common. "1d80ff1d8d24a4a2f5efae1289a6c6b0da09a0da" and "a13f1e2a0d33e8db43b1d44fbd9e68af43ba7e55" have entirely different histories.
1d80ff1d8d
...
a13f1e2a0d
|
@ -6,9 +6,6 @@ SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 10.0.1-SNAPSHOT
|
|
||||||
- Remove `label()` option from `Armor` operation
|
|
||||||
|
|
||||||
## 10.0.0
|
## 10.0.0
|
||||||
- Update implementation to [SOP Specification revision 10](https://www.ietf.org/archive/id/draft-dkg-openpgp-stateless-cli-10.html).
|
- Update implementation to [SOP Specification revision 10](https://www.ietf.org/archive/id/draft-dkg-openpgp-stateless-cli-10.html).
|
||||||
- Throw `BadData` when passing KEYS where CERTS are expected
|
- Throw `BadData` when passing KEYS where CERTS are expected
|
||||||
|
|
|
@ -7,6 +7,7 @@ package sop.external.operation
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
import sop.Ready
|
import sop.Ready
|
||||||
|
import sop.enums.ArmorLabel
|
||||||
import sop.exception.SOPGPException
|
import sop.exception.SOPGPException
|
||||||
import sop.external.ExternalSOP
|
import sop.external.ExternalSOP
|
||||||
import sop.operation.Armor
|
import sop.operation.Armor
|
||||||
|
@ -17,6 +18,8 @@ class ArmorExternal(binary: String, environment: Properties) : Armor {
|
||||||
private val commandList: MutableList<String> = mutableListOf(binary, "armor")
|
private val commandList: MutableList<String> = mutableListOf(binary, "armor")
|
||||||
private val envList: List<String> = ExternalSOP.propertiesToEnv(environment)
|
private val envList: List<String> = ExternalSOP.propertiesToEnv(environment)
|
||||||
|
|
||||||
|
override fun label(label: ArmorLabel): Armor = apply { commandList.add("--label=$label") }
|
||||||
|
|
||||||
@Throws(SOPGPException.BadData::class)
|
@Throws(SOPGPException.BadData::class)
|
||||||
override fun data(data: InputStream): Ready =
|
override fun data(data: InputStream): Ready =
|
||||||
ExternalSOP.executeTransformingOperation(Runtime.getRuntime(), commandList, envList, data)
|
ExternalSOP.executeTransformingOperation(Runtime.getRuntime(), commandList, envList, data)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
usage.header=Add ASCII Armor to standard input
|
usage.header=Add ASCII Armor to standard input
|
||||||
|
label=Label to be used in the header and tail of the armoring
|
||||||
|
|
||||||
stacktrace=Print stacktrace
|
stacktrace=Print stacktrace
|
||||||
# Generic TODO: Remove when bumping picocli to 4.7.0
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
usage.header=Schütze Standard-Eingabe mit ASCII Armor
|
usage.header=Schütze Standard-Eingabe mit ASCII Armor
|
||||||
|
label=Label für Kopf- und Fußzeile der ASCII Armor
|
||||||
|
|
||||||
stacktrace=Stacktrace ausgeben
|
stacktrace=Stacktrace ausgeben
|
||||||
# Generic TODO: Remove when bumping picocli to 4.7.0
|
# Generic TODO: Remove when bumping picocli to 4.7.0
|
||||||
|
|
14
sop-java/src/main/kotlin/sop/enums/ArmorLabel.kt
Normal file
14
sop-java/src/main/kotlin/sop/enums/ArmorLabel.kt
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package sop.enums
|
||||||
|
|
||||||
|
@Deprecated("Use of armor labels is deprecated.")
|
||||||
|
enum class ArmorLabel {
|
||||||
|
auto,
|
||||||
|
sig,
|
||||||
|
key,
|
||||||
|
cert,
|
||||||
|
message
|
||||||
|
}
|
|
@ -7,10 +7,22 @@ package sop.operation
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import sop.Ready
|
import sop.Ready
|
||||||
|
import sop.enums.ArmorLabel
|
||||||
import sop.exception.SOPGPException.BadData
|
import sop.exception.SOPGPException.BadData
|
||||||
|
import sop.exception.SOPGPException.UnsupportedOption
|
||||||
|
|
||||||
interface Armor {
|
interface Armor {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Overrides automatic detection of label.
|
||||||
|
*
|
||||||
|
* @param label armor label
|
||||||
|
* @return builder instance
|
||||||
|
*/
|
||||||
|
@Deprecated("Use of armor labels is deprecated and will be removed in a future release.")
|
||||||
|
@Throws(UnsupportedOption::class)
|
||||||
|
fun label(label: ArmorLabel): Armor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Armor the provided data.
|
* Armor the provided data.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue