mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2024-11-22 23:22:05 +01:00
Kotlin conversion: EncryptAs
This commit is contained in:
parent
d5c0d4e390
commit
1c290e0c8f
3 changed files with 12 additions and 18 deletions
|
@ -1,16 +0,0 @@
|
||||||
// SPDX-FileCopyrightText: 2021 Paul Schaub <vanitasvitae@fsfe.org>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
package sop.enums;
|
|
||||||
|
|
||||||
public enum EncryptAs {
|
|
||||||
Binary,
|
|
||||||
Text,
|
|
||||||
;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return super.toString().toLowerCase();
|
|
||||||
}
|
|
||||||
}
|
|
10
sop-java/src/main/kotlin/sop/enums/EncryptAs.kt
Normal file
10
sop-java/src/main/kotlin/sop/enums/EncryptAs.kt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package sop.enums
|
||||||
|
|
||||||
|
enum class EncryptAs {
|
||||||
|
binary,
|
||||||
|
text
|
||||||
|
}
|
|
@ -142,7 +142,7 @@ public class EncryptDecryptTest extends AbstractSOPTest {
|
||||||
byte[] ciphertext = sop.encrypt()
|
byte[] ciphertext = sop.encrypt()
|
||||||
.withCert(TestData.ALICE_CERT.getBytes(StandardCharsets.UTF_8))
|
.withCert(TestData.ALICE_CERT.getBytes(StandardCharsets.UTF_8))
|
||||||
.signWith(TestData.ALICE_KEY.getBytes(StandardCharsets.UTF_8))
|
.signWith(TestData.ALICE_KEY.getBytes(StandardCharsets.UTF_8))
|
||||||
.mode(EncryptAs.Binary)
|
.mode(EncryptAs.binary)
|
||||||
.plaintext(message)
|
.plaintext(message)
|
||||||
.getBytes();
|
.getBytes();
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ public class EncryptDecryptTest extends AbstractSOPTest {
|
||||||
byte[] ciphertext = sop.encrypt()
|
byte[] ciphertext = sop.encrypt()
|
||||||
.withCert(TestData.ALICE_CERT.getBytes(StandardCharsets.UTF_8))
|
.withCert(TestData.ALICE_CERT.getBytes(StandardCharsets.UTF_8))
|
||||||
.signWith(TestData.ALICE_KEY.getBytes(StandardCharsets.UTF_8))
|
.signWith(TestData.ALICE_KEY.getBytes(StandardCharsets.UTF_8))
|
||||||
.mode(EncryptAs.Text)
|
.mode(EncryptAs.text)
|
||||||
.plaintext(message)
|
.plaintext(message)
|
||||||
.getBytes();
|
.getBytes();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue