1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-09 02:09:38 +02:00

GenerateKeyTest: test user-id with whitespace

This commit is contained in:
Paul Schaub 2025-08-30 11:47:24 +02:00
parent e4cf656af9
commit bd991d0a78
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -15,6 +15,7 @@ import java.io.IOException;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.api.OpenPGPKey;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.pgpainless.PGPainless;
@ -108,6 +109,7 @@ public class GenerateKeyTest {
.generate()
.getBytes();
assertTrue(new String(keyBytes).contains("Foo\\n\\nBar"));
OpenPGPKey key = PGPainless.getInstance().readKey().parseKey(keyBytes);
assertTrue(key.getValidUserIds().get(0).getUserId().equals("Foo\n\nBar"));
}
}