Kotlin conversion: SignAs

This commit is contained in:
Paul Schaub 2023-10-31 14:51:16 +01:00
parent be6be3deac
commit 30c369d24a
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 13 additions and 24 deletions

View file

@ -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();
}
}

View 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
}

View file

@ -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();