1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-17 09:04:50 +02:00

We can once again compile"

This commit is contained in:
Paul Schaub 2023-06-19 10:58:04 +02:00
parent 2a858baee1
commit 96468ba3d2
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
5 changed files with 14 additions and 71 deletions

View file

@ -23,6 +23,7 @@ dependencies {
// Certificate store
api "org.pgpainless:pgp-certificate-store:$certDJavaVersion"
api "org.pgpainless:pgpainless-cert-d:$pgpainlessCertDVersion"
}
test {

View file

@ -1,7 +1,7 @@
package org.pgpainless.wot;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import pgp.certificate_store.Certificate;
import pgp.certificate_store.certificate.Certificate;
import pgp.certificate_store.exception.BadDataException;
import java.io.IOException;
@ -18,8 +18,8 @@ public class WebOfTrust implements CertificateAuthority {
* Do the heavy lifting of calculating the web of trust.
*/
public void initialize() throws BadDataException, IOException {
Certificate trustRoot = certificateStore.getTrustRoot();
Certificate trustRoot = certificateStore.getTrustRootCertificate();
// TODO: Implement
}
@Override

View file

@ -1,74 +1,12 @@
package org.pgpainless.wot;
import pgp.certificate_store.Certificate;
import pgp.certificate_store.CertificateDirectory;
import pgp.certificate_store.MergeCallback;
import pgp.certificate_store.exception.BadDataException;
import pgp.certificate_store.exception.BadNameException;
import pgp.cert_d.PGPCertificateDirectory;
import pgp.cert_d.subkey_lookup.SubkeyLookup;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
public class WebOfTrustCertificateStore extends PGPCertificateDirectory {
public class WebOfTrustCertificateStore implements CertificateDirectory {
private final CertificateDirectory certificateDirectory;
public WebOfTrustCertificateStore(CertificateDirectory certificateDirectory) {
this.certificateDirectory = certificateDirectory;
public WebOfTrustCertificateStore(Backend backend, SubkeyLookup subkeyLookup) {
super(backend, subkeyLookup);
}
public Certificate getTrustRoot() throws BadDataException, IOException {
try {
return getCertificate("trust-root");
} catch (BadNameException e) {
throw new AssertionError("The underlying certificate directory MUST support getting a trust-root certificate.");
}
}
@Override
public Certificate getCertificate(String identifier)
throws IOException, BadNameException, BadDataException {
return certificateDirectory.getCertificate(identifier);
}
@Override
public Certificate getCertificateIfChanged(String identifier, String tag)
throws IOException, BadNameException, BadDataException {
return certificateDirectory.getCertificateIfChanged(identifier, tag);
}
@Override
public Certificate insertCertificate(InputStream data, MergeCallback merge)
throws IOException, InterruptedException, BadDataException {
return certificateDirectory.insertCertificate(data, merge);
}
@Override
public Certificate tryInsertCertificate(InputStream data, MergeCallback merge)
throws IOException, BadDataException {
return certificateDirectory.tryInsertCertificate(data, merge);
}
@Override
public Certificate insertCertificateBySpecialName(String specialName, InputStream data, MergeCallback merge)
throws IOException, InterruptedException, BadDataException, BadNameException {
return certificateDirectory.insertCertificateBySpecialName(specialName, data, merge);
}
@Override
public Certificate tryInsertCertificateBySpecialName(String specialName, InputStream data, MergeCallback merge)
throws IOException, BadDataException, BadNameException {
return certificateDirectory.tryInsertCertificateBySpecialName(specialName, data, merge);
}
@Override
public Iterator<Certificate> getCertificates() {
return certificateDirectory.getCertificates();
}
@Override
public Iterator<String> getFingerprints() {
return certificateDirectory.getFingerprints();
}
}

View file

@ -6,5 +6,7 @@ rootProject.name = 'PGPainless'
include 'pgpainless-core',
'pgpainless-sop',
'pgpainless-cli'
'pgpainless-cli',
'pgpainless-wot',
'wot-dijkstra'

View file

@ -12,6 +12,8 @@ allprojects {
bouncyPgVersion = bouncyCastleVersion
junitVersion = '5.8.2'
logbackVersion = '1.2.11'
certDJavaVersion = '0.2.1'
pgpainlessCertDVersion = '0.2.1'
mockitoVersion = '4.5.1'
slf4jVersion = '1.7.36'
sopJavaVersion = '6.1.0'