mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 02:39:39 +02:00
SOP: Add convenience methods to deal with byte arrays
This commit is contained in:
parent
32f3f0246e
commit
15736586dd
25 changed files with 451 additions and 128 deletions
|
@ -7,7 +7,6 @@ package org.pgpainless.sop;
|
|||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
|
@ -76,13 +75,13 @@ public class ExtractCertTest {
|
|||
assertArrayEquals(
|
||||
cert.getBytes(StandardCharsets.UTF_8),
|
||||
sop.extractCert()
|
||||
.key(new ByteArrayInputStream(key.getBytes(StandardCharsets.UTF_8)))
|
||||
.key(key.getBytes(StandardCharsets.UTF_8))
|
||||
.getBytes());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyKeyDataYieldsBadData() {
|
||||
assertThrows(SOPGPException.BadData.class, () -> sop.extractCert()
|
||||
.key(new ByteArrayInputStream(new byte[0])));
|
||||
.key(new byte[0]));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue