decryptverify: add trivial detection of pgp ascii-armored data

This commit is contained in:
Vincent Breitmoser
2015-09-29 20:20:26 +02:00
parent 5b6c04cbfb
commit f461d6b1d8
2 changed files with 36 additions and 2 deletions

View File

@@ -354,6 +354,9 @@ public class ExportTest {
"backup_" + KeyFormattingUtils.convertKeyIdToHex(mStaticRing1.getMasterKeyId()) + ".pub.asc",
result.getDecryptionMetadata().getFilename());
assertEquals("mime type for pgp keys must be correctly detected",
"application/pgp-keys", result.getDecryptionMetadata().getMimeType());
TestingUtils.assertArrayEqualsPrefix("exported data must start with ascii armor header",
"-----BEGIN PGP PUBLIC KEY BLOCK-----\n".getBytes(), result.getOutputBytes());
TestingUtils.assertArrayEqualsSuffix("exported data must end with ascii armor header",