Move PGP object factory code into a dedicated Utils class

Ghostryde.java has a lot of duplicate code with RydeEncoder and the future
RydeDecoder - the encryption/decryption, compression/decompression, file
encoding/decoding. The "de-XXX" part of each of these pairs needs to read a PGP
object from a stream using PGPObjectFactory.

Since we want to move the duplicate code into their own files, we will need to
move the "read PGP objects from stream" functions to a common utility class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205092800
This commit is contained in:
guyben 2018-07-18 09:51:06 -07:00 committed by jianglai
parent 8c5b647f52
commit 9a65887789
3 changed files with 90 additions and 38 deletions

View file

@ -229,7 +229,8 @@ public class GhostrydeTest {
});
assertThat(thrown)
.hasMessageThat()
.contains("Message was encrypted for keyid a59c132f3589a1d5 but ours is c9598c84ec70b9fd");
.contains(
"Message was encrypted for keyids [a59c132f3589a1d5] but ours is c9598c84ec70b9fd");
}
@Test