mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 04:17:59 +01:00
We can once again compile"
This commit is contained in:
parent
90e87ccab4
commit
ca81c0d862
5 changed files with 14 additions and 71 deletions
|
@ -23,6 +23,7 @@ dependencies {
|
||||||
|
|
||||||
// Certificate store
|
// Certificate store
|
||||||
api "org.pgpainless:pgp-certificate-store:$certDJavaVersion"
|
api "org.pgpainless:pgp-certificate-store:$certDJavaVersion"
|
||||||
|
api "org.pgpainless:pgpainless-cert-d:$pgpainlessCertDVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package org.pgpainless.wot;
|
package org.pgpainless.wot;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import pgp.certificate_store.Certificate;
|
import pgp.certificate_store.certificate.Certificate;
|
||||||
import pgp.certificate_store.exception.BadDataException;
|
import pgp.certificate_store.exception.BadDataException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -18,8 +18,8 @@ public class WebOfTrust implements CertificateAuthority {
|
||||||
* Do the heavy lifting of calculating the web of trust.
|
* Do the heavy lifting of calculating the web of trust.
|
||||||
*/
|
*/
|
||||||
public void initialize() throws BadDataException, IOException {
|
public void initialize() throws BadDataException, IOException {
|
||||||
Certificate trustRoot = certificateStore.getTrustRoot();
|
Certificate trustRoot = certificateStore.getTrustRootCertificate();
|
||||||
|
// TODO: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,74 +1,12 @@
|
||||||
package org.pgpainless.wot;
|
package org.pgpainless.wot;
|
||||||
|
|
||||||
import pgp.certificate_store.Certificate;
|
import pgp.cert_d.PGPCertificateDirectory;
|
||||||
import pgp.certificate_store.CertificateDirectory;
|
import pgp.cert_d.subkey_lookup.SubkeyLookup;
|
||||||
import pgp.certificate_store.MergeCallback;
|
|
||||||
import pgp.certificate_store.exception.BadDataException;
|
|
||||||
import pgp.certificate_store.exception.BadNameException;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
public class WebOfTrustCertificateStore extends PGPCertificateDirectory {
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
public class WebOfTrustCertificateStore implements CertificateDirectory {
|
public WebOfTrustCertificateStore(Backend backend, SubkeyLookup subkeyLookup) {
|
||||||
|
super(backend, subkeyLookup);
|
||||||
private final CertificateDirectory certificateDirectory;
|
|
||||||
|
|
||||||
public WebOfTrustCertificateStore(CertificateDirectory certificateDirectory) {
|
|
||||||
this.certificateDirectory = certificateDirectory;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,7 @@ rootProject.name = 'PGPainless'
|
||||||
|
|
||||||
include 'pgpainless-core',
|
include 'pgpainless-core',
|
||||||
'pgpainless-sop',
|
'pgpainless-sop',
|
||||||
'pgpainless-cli'
|
'pgpainless-cli',
|
||||||
|
'pgpainless-wot',
|
||||||
|
'wot-dijkstra'
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@ allprojects {
|
||||||
bouncyPgVersion = bouncyCastleVersion
|
bouncyPgVersion = bouncyCastleVersion
|
||||||
junitVersion = '5.8.2'
|
junitVersion = '5.8.2'
|
||||||
logbackVersion = '1.2.11'
|
logbackVersion = '1.2.11'
|
||||||
|
certDJavaVersion = '0.2.1'
|
||||||
|
pgpainlessCertDVersion = '0.2.1'
|
||||||
mockitoVersion = '4.5.1'
|
mockitoVersion = '4.5.1'
|
||||||
slf4jVersion = '1.7.36'
|
slf4jVersion = '1.7.36'
|
||||||
sopJavaVersion = '7.0.0'
|
sopJavaVersion = '7.0.0'
|
||||||
|
|
Loading…
Reference in a new issue