Add javadoc and move http-independent WKDFetcher logic to AbstractWKDFetchet class.

This commit is contained in:
Paul Schaub 2022-02-23 19:54:32 +01:00
parent 9abe217de0
commit 5613d42baf
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
8 changed files with 218 additions and 62 deletions

View file

@ -4,6 +4,10 @@
package pgp.wkd.cli;
/**
* Exception that gets thrown when an OpenPGP certificate is not carrying a User-ID binding for the email address
* that was used to look the certificate up via WKD.
*/
public class MissingUserIdException extends Exception {
public MissingUserIdException() {

View file

@ -8,8 +8,8 @@ import org.bouncycastle.bcpg.ArmoredOutputStream;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.pgpainless.PGPainless;
import org.pgpainless.key.info.KeyRingInfo;
import pgp.wkd.IWKDFetcher;
import pgp.wkd.JavaHttpRequestWKDFetcher;
import pgp.wkd.AbstractWKDFetcher;
import pgp.wkd.HttpUrlConnectionWKDFetcher;
import pgp.wkd.WKDAddress;
import pgp.wkd.WKDAddressHelper;
import pgp.wkd.cli.MissingUserIdException;
@ -40,7 +40,7 @@ public class Fetch implements Runnable {
)
boolean armor = false;
IWKDFetcher fetcher = new JavaHttpRequestWKDFetcher();
AbstractWKDFetcher fetcher = new HttpUrlConnectionWKDFetcher();
@Override
public void run() {