diff --git a/sop-java-testfixtures/src/main/java/sop/testsuite/operation/EncryptDecryptTest.java b/sop-java-testfixtures/src/main/java/sop/testsuite/operation/EncryptDecryptTest.java index 330ca90..df824ca 100644 --- a/sop-java-testfixtures/src/main/java/sop/testsuite/operation/EncryptDecryptTest.java +++ b/sop-java-testfixtures/src/main/java/sop/testsuite/operation/EncryptDecryptTest.java @@ -11,15 +11,12 @@ import org.junit.jupiter.params.provider.MethodSource; import sop.ByteArrayAndResult; import sop.DecryptionResult; import sop.EncryptionResult; -import sop.Profile; import sop.SOP; import sop.SessionKey; import sop.Verification; import sop.enums.EncryptAs; import sop.enums.SignatureMode; import sop.exception.SOPGPException; -import sop.operation.Decrypt; -import sop.operation.Encrypt; import sop.testsuite.TestData; import sop.testsuite.assertions.VerificationListAssert; import sop.util.Optional; @@ -28,7 +25,6 @@ import sop.util.UTCUtil; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.text.ParseException; -import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Stream; @@ -342,55 +338,4 @@ public class EncryptDecryptTest extends AbstractSOPTest { .toByteArrayAndResult() .getBytes()); } - - @ParameterizedTest - @MethodSource("provideInstances") - public void encryptDecryptWithAllSupportedKeyGenerationProfiles(SOP sop) throws IOException { - List profiles = sop.listProfiles().generateKey(); - - List keys = new ArrayList<>(); - List certs = new ArrayList<>(); - for (Profile p : profiles) { - byte[] k = sop.generateKey() - .profile(p) - .userId(p.getName()) - .generate() - .getBytes(); - keys.add(k); - - byte[] c = sop.extractCert() - .key(k) - .getBytes(); - certs.add(c); - } - - byte[] plaintext = "Hello, World!\n".getBytes(); - - Encrypt encrypt = sop.encrypt(); - for (byte[] c : certs) { - encrypt.withCert(c); - } - for (byte[] k : keys) { - encrypt.signWith(k); - } - - ByteArrayAndResult encRes = encrypt.plaintext(plaintext) - .toByteArrayAndResult(); - EncryptionResult eResult = encRes.getResult(); - byte[] ciphertext = encRes.getBytes(); - - for (byte[] k : keys) { - Decrypt decrypt = sop.decrypt() - .withKey(k); - for (byte[] c : certs) { - decrypt.verifyWithCert(c); - } - ByteArrayAndResult decRes = decrypt.ciphertext(ciphertext) - .toByteArrayAndResult(); - DecryptionResult dResult = decRes.getResult(); - byte[] decPlaintext = decRes.getBytes(); - assertArrayEquals(plaintext, decPlaintext); - assertEquals(certs.size(), dResult.getVerifications().size()); - } - } } diff --git a/sop-java/src/main/kotlin/sop/Profile.kt b/sop-java/src/main/kotlin/sop/Profile.kt index fd58c63..725bbe5 100644 --- a/sop-java/src/main/kotlin/sop/Profile.kt +++ b/sop-java/src/main/kotlin/sop/Profile.kt @@ -50,16 +50,6 @@ data class Profile( fun hasDescription() = description.isPresent - /** - * Return a copy of this [Profile] with the aliases set to the given strings. - * - * @param alias one or more alias names - * @return profile with aliases - */ - fun withAliases(vararg alias: String): Profile { - return Profile(name, description, alias.toList()) - } - /** * Convert the profile into a String for displaying. * diff --git a/sop-java/src/test/java/sop/ProfileTest.java b/sop-java/src/test/java/sop/ProfileTest.java index f418672..41b4a2f 100644 --- a/sop-java/src/test/java/sop/ProfileTest.java +++ b/sop-java/src/test/java/sop/ProfileTest.java @@ -39,20 +39,6 @@ public class ProfileTest { assertEquals(Arrays.asList("Bar", "Baz"), profile.getAliases()); } - @Test - public void changeAliasesWithWithAliases() { - Profile p = new Profile("Foo", "Bar any Baz", Arrays.asList("tinitus", "particle")); - p = p.withAliases("fnord", "qbit"); - - assertEquals("Foo", p.getName()); - assertEquals("Bar any Baz", p.getDescription().get()); - - assertTrue(p.getAliases().contains("fnord")); - assertTrue(p.getAliases().contains("qbit")); - assertFalse(p.getAliases().contains("tinitus")); - assertFalse(p.getAliases().contains("particle")); - } - @Test public void toStringNameOnly() { Profile profile = new Profile("default");