mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-29 10:32:08 +01:00
Kotlin conversion: SignAs
This commit is contained in:
parent
be6be3deac
commit
30c369d24a
3 changed files with 13 additions and 24 deletions
|
@ -1,23 +0,0 @@
|
|||
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package sop.enums;
|
||||
|
||||
public enum SignAs {
|
||||
/**
|
||||
* Signature is made over the binary message.
|
||||
*/
|
||||
Binary,
|
||||
|
||||
/**
|
||||
* Signature is made over the message in text mode.
|
||||
*/
|
||||
Text,
|
||||
;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString().toLowerCase();
|
||||
}
|
||||
}
|
12
sop-java/src/main/kotlin/sop/enums/SignAs.kt
Normal file
12
sop-java/src/main/kotlin/sop/enums/SignAs.kt
Normal file
|
@ -0,0 +1,12 @@
|
|||
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package sop.enums
|
||||
|
||||
enum class SignAs {
|
||||
/** Signature is made over the binary message. */
|
||||
binary,
|
||||
/** Signature is made over the message in text mode. */
|
||||
text
|
||||
}
|
|
@ -62,7 +62,7 @@ public class DetachedSignDetachedVerifyTest extends AbstractSOPTest {
|
|||
|
||||
byte[] signature = sop.detachedSign()
|
||||
.key(TestData.ALICE_KEY.getBytes(StandardCharsets.UTF_8))
|
||||
.mode(SignAs.Text)
|
||||
.mode(SignAs.text)
|
||||
.data(message)
|
||||
.toByteArrayAndResult()
|
||||
.getBytes();
|
||||
|
|
Loading…
Reference in a new issue