aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OpenKeychain/src/test/java/tests/UncachedKeyringTest.java11
-rw-r--r--OpenKeychain/src/test/resources/public-key-canonicalize.blobbin0 -> 1224 bytes
2 files changed, 10 insertions, 1 deletions
diff --git a/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java b/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java
index cb44d5d8f..b14bc2301 100644
--- a/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java
+++ b/OpenKeychain/src/test/java/tests/UncachedKeyringTest.java
@@ -10,6 +10,7 @@ import org.sufficientlysecure.keychain.testsupport.KeyringBuilder;
import org.sufficientlysecure.keychain.testsupport.TestDataUtil;
import java.io.*;
+import java.util.Collections;
@RunWith(RobolectricTestRunner.class)
@org.robolectric.annotation.Config(emulateSdk = 18) // Robolectric doesn't yet support 19
@@ -19,11 +20,19 @@ public class UncachedKeyringTest {
public void testVerifySuccess() throws Exception {
UncachedKeyRing expectedKeyRing = KeyringBuilder.ring2();
UncachedKeyRing inputKeyRing = KeyringBuilder.ring1();
- // Uncomment to dump the encoded key for manual inspection
+// Uncomment to dump the encoded key for manual inspection
// inputKeyRing.getPublicKey().getPublicKey().encode(new FileOutputStream(new File("/tmp/key-encoded")));
new UncachedKeyringTestingHelper().doTestCanonicalize(inputKeyRing, expectedKeyRing);
}
+ @Test
+ public void testVerifyFromGpg() throws Exception {
+ byte[] data = TestDataUtil.readAllFully(Collections.singleton( "/public-key-canonicalize.blob"));
+ UncachedKeyRing inputKeyRing = UncachedKeyRing.decodeFromData(data);
+ new UncachedKeyringTestingHelper().doTestCanonicalize(inputKeyRing, KeyringBuilder.ring2());
+ }
+
+
/**
* Just testing my own test code. Should really be using a library for this.
*/
diff --git a/OpenKeychain/src/test/resources/public-key-canonicalize.blob b/OpenKeychain/src/test/resources/public-key-canonicalize.blob
new file mode 100644
index 000000000..3450824c1
--- /dev/null
+++ b/OpenKeychain/src/test/resources/public-key-canonicalize.blob
Binary files differ