mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 04:17:59 +01:00
Add felix.pub and test for anomaly (wip)
This commit is contained in:
parent
af8b065469
commit
68a548ac1d
4 changed files with 8945 additions and 0 deletions
|
@ -155,4 +155,14 @@ public class WebOfTrustTest {
|
|||
assertTrue(network.getEdges().isEmpty());
|
||||
assertTrue(network.getReverseEdges().isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWotWithAnomaly() throws BadDataException, IOException, InterruptedException {
|
||||
PGPCertificateDirectory store = TestCertificateStores.anomalyGraph();
|
||||
WebOfTrust wot = new WebOfTrust(store);
|
||||
wot.initialize();
|
||||
Network network = wot.getNetwork();
|
||||
|
||||
assertEquals(1, network.getNodes().size());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,13 @@ public class TestCertificateStores {
|
|||
return certD;
|
||||
}
|
||||
|
||||
public static PGPCertificateDirectory anomalyGraph()
|
||||
throws BadDataException, IOException, InterruptedException {
|
||||
PGPCertificateDirectory wotStore = createInMemoryCertificateDirectory();
|
||||
wotStore.insert(getTestVector("anomalies/felix.pub"), merger);
|
||||
return wotStore;
|
||||
}
|
||||
|
||||
private static PGPCertificateDirectory createInMemoryCertificateDirectory() {
|
||||
SubkeyLookup subkeyLookup = new InMemorySubkeyLookup();
|
||||
KeyMaterialReaderBackend readerBackend = new KeyMaterialReader();
|
||||
|
|
|
@ -282,4 +282,9 @@ public class WotTestVectors {
|
|||
}
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
public PGPPublicKeyRing getFelixKey()
|
||||
throws IOException {
|
||||
return PGPainless.readKeyRing().publicKeyRing(getTestResourceInputStream("test_vectors/anomalies/felix.pub"));
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue