mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-16 17:32:06 +01:00
Fix Dearmor command test to check for new CTB use
This commit is contained in:
parent
6cfec53f12
commit
2e29fc3026
1 changed files with 13 additions and 2 deletions
|
@ -16,6 +16,7 @@ import java.security.InvalidAlgorithmParameterException;
|
|||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import com.ginsberg.junit.exit.FailOnSystemExit;
|
||||
import org.bouncycastle.bcpg.BCPGOutputStream;
|
||||
import org.bouncycastle.openpgp.PGPException;
|
||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||
|
@ -51,7 +52,12 @@ public class DearmorTest {
|
|||
System.setOut(new PrintStream(out));
|
||||
PGPainlessCLI.execute("dearmor");
|
||||
|
||||
assertArrayEquals(secretKey.getEncoded(), out.toByteArray());
|
||||
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
|
||||
BCPGOutputStream bcpgOut = new BCPGOutputStream(byteOut, true);
|
||||
secretKey.encode(bcpgOut);
|
||||
bcpgOut.close();
|
||||
|
||||
assertArrayEquals(byteOut.toByteArray(), out.toByteArray());
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,7 +74,12 @@ public class DearmorTest {
|
|||
System.setOut(new PrintStream(out));
|
||||
PGPainlessCLI.execute("dearmor");
|
||||
|
||||
assertArrayEquals(certificate.getEncoded(), out.toByteArray());
|
||||
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
|
||||
BCPGOutputStream bcpgOut = new BCPGOutputStream(byteOut, true);
|
||||
certificate.encode(bcpgOut);
|
||||
bcpgOut.close();
|
||||
|
||||
assertArrayEquals(byteOut.toByteArray(), out.toByteArray());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in a new issue