From d5f3ca9ea1e78cd590623c4d2781112a631d9eb7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 6 Apr 2022 13:51:30 +0200 Subject: [PATCH 01/35] VKS-Java 0.1.1-SNAPSHOT --- version.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.gradle b/version.gradle index ef567db..8542a92 100644 --- a/version.gradle +++ b/version.gradle @@ -4,8 +4,8 @@ allprojects { ext { - shortVersion = '0.1.0' - isSnapshot = false + shortVersion = '0.1.1' + isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 } From 352f6d3c7f5a378384a35a6cd5a5735c147011bd Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 6 Apr 2022 14:11:20 +0200 Subject: [PATCH 02/35] Add vks-java/README --- vks-java/README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 vks-java/README.md diff --git a/vks-java/README.md b/vks-java/README.md new file mode 100644 index 0000000..f499bdb --- /dev/null +++ b/vks-java/README.md @@ -0,0 +1,28 @@ + + +# VKS-Java + +[![javadoc](https://javadoc.io/badge2/org.pgpainless/vks-java/javadoc.svg)](https://javadoc.io/doc/org.pgpainless/vks-java) +[![Maven Central](https://badgen.net/maven/v/maven-central/org.pgpainless/vks-java)](https://search.maven.org/artifact/org.pgpainless/vks-java) + +Client Side API for Communicating with Verifying Key Servers. + +```java +VKS vks = new VKSImpl("https://keys.openpgp.org/"); + +// Key Discovery via Email, key-id or fingerprint +InputStream bobsKey = vks.get().byEmail("bob@pgpainless.org"); + +// Upload Key to the VKS +InputStream myKey = ... +Upload.Response uploadResponse = vks.upload().cert(myKey); + +// Request email verification of user-ids +RequestVerify.Response verifyResponse = vks.requestVerification() + .forEmailAddress("bob@pgpainless.org") + .execute(uploadResponse.getToken()); +``` From 181af197b55ce7989d7088b3d053281a3dba9156 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 6 Apr 2022 16:17:57 +0200 Subject: [PATCH 03/35] Add vks-java-cli Command Line Frontend --- settings.gradle | 3 +- vks-java-cli/build.gradle | 32 ++++++++ .../main/java/pgp/vks/client/cli/GetCmd.java | 74 +++++++++++++++++ .../client/cli/RequestVerificationCmd.java | 58 ++++++++++++++ .../java/pgp/vks/client/cli/UploadCmd.java | 79 +++++++++++++++++++ .../main/java/pgp/vks/client/cli/VKSCLI.java | 60 ++++++++++++++ .../java/pgp/vks/client/cli/package-info.java | 8 ++ 7 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 vks-java-cli/build.gradle create mode 100644 vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java create mode 100644 vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java create mode 100644 vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java create mode 100644 vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java create mode 100644 vks-java-cli/src/main/java/pgp/vks/client/cli/package-info.java diff --git a/settings.gradle b/settings.gradle index a636bb0..25d5c44 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,4 +4,5 @@ rootProject.name = 'VKS-Java' -include 'vks-java' \ No newline at end of file +include 'vks-java', + 'vks-java-cli' \ No newline at end of file diff --git a/vks-java-cli/build.gradle b/vks-java-cli/build.gradle new file mode 100644 index 0000000..4e96ef4 --- /dev/null +++ b/vks-java-cli/build.gradle @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +plugins { + id 'application' +} + +group 'org.pgpainless' + +repositories { + mavenCentral() +} + +dependencies { + testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" + + // VKS-Java + implementation project(":vks-java") + + // CLI + implementation "info.picocli:picocli:4.6.3" +} + +application { + mainClass = 'pgp.vks.client.cli.VKSCLI' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java new file mode 100644 index 0000000..7f1fa9f --- /dev/null +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java @@ -0,0 +1,74 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +package pgp.vks.client.cli; + +import pgp.vks.client.Get; +import pgp.vks.client.VKS; +import picocli.CommandLine; + +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; + +@CommandLine.Command(name = "get", description = "Retrieve an OpenPGP certificate from the key server") +public class GetCmd implements Runnable { + + @CommandLine.Mixin + VKSCLI.KeyServerMixin keyServerMixin; + + @CommandLine.ArgGroup(exclusive = true, multiplicity = "1") + Exclusive by; + + static class Exclusive { + @CommandLine.Option(names = {"-f", "--by-fingerprint"}, description = "Retrieve a key by its fingerprint (NOT prefixed with '0x')") + String fingerprint; + + @CommandLine.Option(names = {"-i", "--by-keyid"}, description = "Retrieve a key by its decimal key ID or that of one of its subkeys.") + Long keyId; + + @CommandLine.Option(names = {"-e", "--by-email"}, description = "Retrieve a key by email address.") + String email; + } + + public void run() { + VKS vks; + try { + vks = keyServerMixin.parent.getApi(); + } catch (MalformedURLException e) { + throw new AssertionError(e); + } + + Get get = vks.get(); + InputStream inputStream = null; + try { + if (by.fingerprint != null) { + inputStream = get.byFingerprint(by.fingerprint); + } else if (by.keyId != null) { + inputStream = get.byKeyId(by.keyId); + } else if (by.email != null) { + inputStream = get.byEmail(by.email); + } else { + throw new IllegalArgumentException("Missing --by-* option."); + } + + int read; + byte[] buf = new byte[4096]; + while ((read = inputStream.read(buf)) != -1) { + System.out.write(buf, 0, read); + } + + } catch (IOException e) { + throw new AssertionError(e); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } catch (IOException e) { + throw new AssertionError(e); + } + } + } + } +} diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java new file mode 100644 index 0000000..6767f7d --- /dev/null +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java @@ -0,0 +1,58 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +package pgp.vks.client.cli; + +import pgp.vks.client.RequestVerify; +import pgp.vks.client.VKS; +import picocli.CommandLine; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.Arrays; +import java.util.List; + +@CommandLine.Command(name = "request-verification", description = "Request verification for unverified user-ids") +public class RequestVerificationCmd implements Runnable { + + @CommandLine.Mixin + VKSCLI.KeyServerMixin keyServerMixin; + + @CommandLine.Option(names = {"-t", "--token"}, description = "Access token. Can be retrieved by uploading the certificate.", + required = true, arity = "1", paramLabel = "TOKEN") + String token; + + @CommandLine.Option(names = {"-l", "--locale"}, description = "Locale for the verification mail") + List locale = Arrays.asList("en_US", "en_GB"); + + @CommandLine.Option(names = {"-e", "--email"}, description = "Email addresses to request a verification mail for", required = true, arity = "1..*") + String[] addresses = new String[0]; + + + @Override + public void run() { + VKS vks; + try { + vks = keyServerMixin.parent.getApi(); + } catch (MalformedURLException e) { + throw new AssertionError(e); + } + + RequestVerify requestVerify = vks.requestVerification(); + try { + RequestVerify.Response response = requestVerify + .forEmailAddresses(addresses) + .execute(token, locale); + + System.out.println("Verification E-Mails for key " + response.getKeyFingerprint() + " have been sent."); + System.out.println("Token: " + response.getToken()); + System.out.println("Status:"); + for (String address : response.getStatus().keySet()) { + System.out.println("\t" + address + "\t" + response.getStatus().get(address)); + } + } catch (IOException e) { + throw new AssertionError(e); + } + } +} diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java new file mode 100644 index 0000000..cba61bb --- /dev/null +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java @@ -0,0 +1,79 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +package pgp.vks.client.cli; + +import pgp.vks.client.RequestVerify; +import pgp.vks.client.Status; +import pgp.vks.client.Upload; +import pgp.vks.client.VKS; +import pgp.vks.client.exception.CertCannotBePublishedException; +import picocli.CommandLine; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.List; + +@CommandLine.Command(name = "upload", description = "Upload an OpenPGP certificate to the key server") +public class UploadCmd implements Runnable { + + @CommandLine.Mixin + VKSCLI.KeyServerMixin keyServerMixin; + + @CommandLine.Option(names = {"-r", "--request-verification"}, + description = "Request verification mails for unpublished email addresses") + boolean requestVerification; + + public void run() { + VKS vks; + try { + vks = keyServerMixin.parent.getApi(); + } catch (MalformedURLException e) { + throw new AssertionError(e); + } + + Upload upload = vks.upload(); + try { + Upload.Response response = upload.cert(System.in); + + // Unpublished mail addresses + List unpublished = new ArrayList<>(); + int maxMailLen = 0; + for (String address : response.getStatus().keySet()) { + Status status = response.getStatus().get(address); + if (address.length() > maxMailLen) { + maxMailLen = address.length(); + } + if (status != Status.published && status != Status.revoked) { + unpublished.add(address); + } + } + + System.out.println("Uploaded key " + response.getKeyFingerprint()); + System.out.println("Token: " + response.getToken()); + + if (!requestVerification || unpublished.isEmpty()) { + System.out.println("Status:"); + for (String address : response.getStatus().keySet()) { + Status status = response.getStatus().get(address); + System.out.format("%-" + maxMailLen + "s %s\n", address, status); + } + return; + } + + RequestVerify.Response verifyResponse = vks.requestVerification().forEmailAddresses(unpublished.toArray(new String[0])) + .execute(response.getToken()); + System.out.println("Status:"); + for (String address : verifyResponse.getStatus().keySet()) { + Status status = response.getStatus().get(address); + System.out.format("%-" + maxMailLen + "s %s\n", address, status); + } + } catch (CertCannotBePublishedException e) { + throw new AssertionError(e.getMessage()); + } catch (IOException e) { + throw new AssertionError(e); + } + } +} diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java new file mode 100644 index 0000000..c5cba18 --- /dev/null +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java @@ -0,0 +1,60 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +package pgp.vks.client.cli; + +import pgp.vks.client.VKS; +import pgp.vks.client.VKSImpl; +import picocli.CommandLine; + +import java.net.MalformedURLException; + +@CommandLine.Command( + subcommands = { + CommandLine.HelpCommand.class, + GetCmd.class, + UploadCmd.class, + RequestVerificationCmd.class + } +) +public class VKSCLI { + + String keyServer; + + public static void main(String[] args) { + int exitCode = execute(args); + if (exitCode != 0) { + System.exit(exitCode); + } + } + + public static int execute(String[] args) { + return new CommandLine(VKSCLI.class) + .setExitCodeExceptionMapper(new CommandLine.IExitCodeExceptionMapper() { + @Override + public int getExitCode(Throwable exception) { + return 1; + } + }) + .setCommandName("vkscli") + .execute(args); + } + + public VKS getApi() throws MalformedURLException { + return new VKSImpl(keyServer); + } + + public static class KeyServerMixin { + + @CommandLine.ParentCommand + VKSCLI parent; + + @CommandLine.Option(names = "--key-server", + description = "Address of the Verifying Key Server.\nDefaults to 'https://keys.openpgp.org'", + paramLabel = "KEYSERVER") + public void setKeyServer(String keyServer) { + parent.keyServer = keyServer; + } + } +} diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/package-info.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/package-info.java new file mode 100644 index 0000000..d6af2a8 --- /dev/null +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/package-info.java @@ -0,0 +1,8 @@ +// SPDX-FileCopyrightText: 2022 Paul Schaub +// +// SPDX-License-Identifier: Apache-2.0 + +/** + * Command Line Interface for VKS-Java. + */ +package pgp.vks.client.cli; From c473e1712c258e7cf8e52cd821221f7d45e7e611 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 6 Apr 2022 16:37:08 +0200 Subject: [PATCH 04/35] Update vks-java-cli/README --- vks-java-cli/README.md | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 vks-java-cli/README.md diff --git a/vks-java-cli/README.md b/vks-java-cli/README.md new file mode 100644 index 0000000..b470332 --- /dev/null +++ b/vks-java-cli/README.md @@ -0,0 +1,48 @@ + + +# VKS-Java-CLI + +[![javadoc](https://javadoc.io/badge2/org.pgpainless/vks-java-cli/javadoc.svg)](https://javadoc.io/doc/org.pgpainless/vks-java-cli) +[![Maven Central](https://badgen.net/maven/v/maven-central/org.pgpainless/vks-java-cli)](https://search.maven.org/artifact/org.pgpainless/vks-java-cli) + +Command Line Frontend for VKS-Java + +```shell +Usage: vkscli [COMMAND] +Commands: + help Displays help information about the specified command + get Retrieve an OpenPGP certificate from the key server + upload Upload an OpenPGP certificate to the key server + request-verification Request verification for unverified user-ids +``` + +## Usage Examples + +By default, the CLI application uses `https://keys.openpgp.org` as key server. +To use another VKS, use the option `--key-server https://your.key.server` in any command. + +To retrieve a key from a Verifying Key Server, use the `get` subcommand: + +```shell +$ ./vks-java-cli get -e vanitasvitae@fsfe.org > foo.asc +$ ./vks-java-cli get -f 7F9116FEA90A5983936C7CFAA027DB2F3E1E118A > foo.asc +$ ./vks-java-cli get -i -2535611045697927659 > foo.asc +``` + +To upload a key, use the `upload` subcommand: + +```shell +$ ./vks-java-cli upload -r < foo.asc +``` + +The option `-r` automatically requests verification mails for unpublished mail addresses. + +To manually request verification mails, use the `request-verification` subcommand, passing it the token acquired by the `upload` command: + +```shell +$ ./vks-java-cli request-verification -t -a foo@bar.baz -a other@email.address +``` From 0ebfadac2a859097dd3f38c31b46f3ce47a0cc49 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 6 Apr 2022 16:41:10 +0200 Subject: [PATCH 05/35] Add build instructions --- vks-java-cli/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/vks-java-cli/README.md b/vks-java-cli/README.md index b470332..8dc777a 100644 --- a/vks-java-cli/README.md +++ b/vks-java-cli/README.md @@ -11,6 +11,13 @@ SPDX-License-Identifier: Apache-2.0 Command Line Frontend for VKS-Java +## Building + +To build the CLI app, use `gradle build`. An archive containing an executable can then be found in `vks-java-cli/build/distributions/`. +Extract it and navigate to the `bin` subdirectory, where you can find `vks-java-cli`/`vks-java-cli.bat` executables. + +## Usage Examples + ```shell Usage: vkscli [COMMAND] Commands: @@ -20,9 +27,7 @@ Commands: request-verification Request verification for unverified user-ids ``` -## Usage Examples - -By default, the CLI application uses `https://keys.openpgp.org` as key server. +By default, the CLI application uses `https://keys.openpgp.org` as key server. To use another VKS, use the option `--key-server https://your.key.server` in any command. To retrieve a key from a Verifying Key Server, use the `get` subcommand: From a36e01d7d21c88c0baf7f68a0ab2a8078e2534b0 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 7 Apr 2022 21:41:27 +0200 Subject: [PATCH 06/35] Move dependency versions into version.gradle and bump bc to 1.71 --- build.gradle | 3 --- version.gradle | 3 +++ vks-java/build.gradle | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 8738719..ce23326 100644 --- a/build.gradle +++ b/build.gradle @@ -70,9 +70,6 @@ allprojects { } project.ext { - junitVersion = '5.8.2' - slf4jVersion = '1.7.32' - logbackVersion = '1.2.10' rootConfigDir = new File(rootDir, 'config') gitCommit = getGitCommit() isContinuousIntegrationEnvironment = Boolean.parseBoolean(System.getenv('CI')) diff --git a/version.gradle b/version.gradle index 8542a92..c31b284 100644 --- a/version.gradle +++ b/version.gradle @@ -8,5 +8,8 @@ allprojects { isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 + junitVersion = '5.8.2' + slf4jVersion = '1.7.32' + logbackVersion = '1.2.10' } } diff --git a/vks-java/build.gradle b/vks-java/build.gradle index f290450..1f0b6f1 100644 --- a/vks-java/build.gradle +++ b/vks-java/build.gradle @@ -17,7 +17,7 @@ dependencies { testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" // Arrays.areEqual, Base64... - implementation("org.bouncycastle:bcutil-jdk15on:1.70") + implementation("org.bouncycastle:bcutil-jdk15to18:1.71") // @Nonnull, @Nullable... implementation "com.google.code.findbugs:jsr305:3.0.2" From 0dc7ba1ecb55c3c0dc63aab6cae7155b08ef9c9d Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 11 Apr 2022 13:23:32 +0200 Subject: [PATCH 07/35] Add missing javadoc --- .../java/pgp/vks/client/RequestVerify.java | 49 +++++++++++++++++++ .../src/main/java/pgp/vks/client/Status.java | 3 ++ .../src/main/java/pgp/vks/client/VKSImpl.java | 5 ++ .../CertCannotBePublishedException.java | 3 ++ .../exception/CertNotFoundException.java | 7 ++- .../exception/UnsupportedApiException.java | 4 ++ .../vks/client/v1/dto/ErrorResponseDto.java | 10 ++++ .../vks/client/v1/dto/UploadRequestDto.java | 29 +++++++++++ .../vks/client/v1/dto/UploadResponseDto.java | 25 ++++++++++ .../client/v1/dto/VerificationRequestDto.java | 20 ++++++++ .../v1/dto/VerificationResponseDto.java | 25 ++++++++++ 11 files changed, 176 insertions(+), 4 deletions(-) diff --git a/vks-java/src/main/java/pgp/vks/client/RequestVerify.java b/vks-java/src/main/java/pgp/vks/client/RequestVerify.java index 3d7fb5d..e28f69f 100644 --- a/vks-java/src/main/java/pgp/vks/client/RequestVerify.java +++ b/vks-java/src/main/java/pgp/vks/client/RequestVerify.java @@ -9,20 +9,54 @@ import java.util.Arrays; import java.util.List; import java.util.Map; +/** + * Request email verification for email addresses of user-ids on a certificate. + */ public interface RequestVerify { + /** + * Request email verification for the given email address. + * + * @param emailAddress email address + * @return builder + */ default ForEmailAddresses forEmailAddress(String emailAddress) { return forEmailAddresses(emailAddress); } + /** + * Request email verification for one or more email addresses. + * + * @param emailAddresses email addresses + * @return builder + */ ForEmailAddresses forEmailAddresses(String... emailAddresses); interface ForEmailAddresses { + /** + * Execute the verification request using the given
token
, retrieved earlier by uploading the + * certificate to the server. + * + * @param token access token to authorize the request + * @return servers successful response + * + * @throws IOException in case of an error + */ default Response execute(String token) throws IOException { return execute(token, Arrays.asList("en_US", "en_GB")); } + /** + * Execute the verification request using the given
token
, retrieved earlier by uploading the + * certificate to the server. + * + * @param token access token to authorize the request + * @param locale list of preferred locales for the verification emails + * @return servers successful response + * + * @throws IOException in case of an error + */ Response execute(String token, List locale) throws IOException; } @@ -41,14 +75,29 @@ public interface RequestVerify { this.token = token; } + /** + * Return the uppercase OpenPGP fingerprint of the certificate. + * + * @return fingerprint + */ public String getKeyFingerprint() { return keyFingerprint; } + /** + * Return a map of {@link Status States} of email addresses of user-ids on the certificate after requesting + * verification. + * @return status map + */ public Map getStatus() { return status; } + /** + * Return an access token to be used to make further requests to the API. + * + * @return token + */ public String getToken() { return token; } diff --git a/vks-java/src/main/java/pgp/vks/client/Status.java b/vks-java/src/main/java/pgp/vks/client/Status.java index a8ead89..5fa35d3 100644 --- a/vks-java/src/main/java/pgp/vks/client/Status.java +++ b/vks-java/src/main/java/pgp/vks/client/Status.java @@ -4,6 +4,9 @@ package pgp.vks.client; +/** + * Enum representing different states an email address of a user-id on a certificate can be in. + */ public enum Status { /** diff --git a/vks-java/src/main/java/pgp/vks/client/VKSImpl.java b/vks-java/src/main/java/pgp/vks/client/VKSImpl.java index b760c88..e273ab9 100644 --- a/vks-java/src/main/java/pgp/vks/client/VKSImpl.java +++ b/vks-java/src/main/java/pgp/vks/client/VKSImpl.java @@ -27,6 +27,11 @@ public class VKSImpl implements VKS { this.api = new URLMapper(vksService); } + /** + * Return a {@link VKSImpl} instance targeting the
https://keys.openpgp.org
VKS. + * + * @return VKS instance + */ @SneakyThrows public static VKS keysDotOpenPgpDotOrg() { return new VKSImpl("https://keys.openpgp.org"); diff --git a/vks-java/src/main/java/pgp/vks/client/exception/CertCannotBePublishedException.java b/vks-java/src/main/java/pgp/vks/client/exception/CertCannotBePublishedException.java index 07b5fc3..2e9eca1 100644 --- a/vks-java/src/main/java/pgp/vks/client/exception/CertCannotBePublishedException.java +++ b/vks-java/src/main/java/pgp/vks/client/exception/CertCannotBePublishedException.java @@ -6,6 +6,9 @@ package pgp.vks.client.exception; import java.net.ConnectException; +/** + * Exception gets thrown when a public key certificate cannot be published for some reason. + */ public class CertCannotBePublishedException extends ConnectException { public CertCannotBePublishedException(String errorMessage) { diff --git a/vks-java/src/main/java/pgp/vks/client/exception/CertNotFoundException.java b/vks-java/src/main/java/pgp/vks/client/exception/CertNotFoundException.java index 039eea7..e18056d 100644 --- a/vks-java/src/main/java/pgp/vks/client/exception/CertNotFoundException.java +++ b/vks-java/src/main/java/pgp/vks/client/exception/CertNotFoundException.java @@ -6,12 +6,11 @@ package pgp.vks.client.exception; import java.net.ConnectException; +/** + * Exception gets thrown when the queried OpenPGP certificate cannot be found on the server. + */ public class CertNotFoundException extends ConnectException { - public CertNotFoundException() { - super(); - } - public CertNotFoundException(String message) { super(message); } diff --git a/vks-java/src/main/java/pgp/vks/client/exception/UnsupportedApiException.java b/vks-java/src/main/java/pgp/vks/client/exception/UnsupportedApiException.java index 7f017b6..a1e399f 100644 --- a/vks-java/src/main/java/pgp/vks/client/exception/UnsupportedApiException.java +++ b/vks-java/src/main/java/pgp/vks/client/exception/UnsupportedApiException.java @@ -4,6 +4,10 @@ package pgp.vks.client.exception; +/** + * Exception gets thrown when an unsupported API {@link pgp.vks.client.VKS.Version} is used. + * E.g. user wants to use some command using v2 API, but implementation only supports v1. + */ public class UnsupportedApiException extends RuntimeException { public UnsupportedApiException(String message) { diff --git a/vks-java/src/main/java/pgp/vks/client/v1/dto/ErrorResponseDto.java b/vks-java/src/main/java/pgp/vks/client/v1/dto/ErrorResponseDto.java index 3208791..71567c0 100644 --- a/vks-java/src/main/java/pgp/vks/client/v1/dto/ErrorResponseDto.java +++ b/vks-java/src/main/java/pgp/vks/client/v1/dto/ErrorResponseDto.java @@ -6,6 +6,11 @@ package pgp.vks.client.v1.dto; import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Error response that gets returned by the server if a POST request fails. + * + * @see VKS API Documentation + */ public class ErrorResponseDto { private final String error; @@ -14,6 +19,11 @@ public class ErrorResponseDto { this.error = error; } + /** + * Return the error message. + * + * @return error message + */ @JsonProperty("error") public String getError() { return error; diff --git a/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadRequestDto.java b/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadRequestDto.java index e351a39..865deb1 100644 --- a/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadRequestDto.java +++ b/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadRequestDto.java @@ -14,6 +14,11 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; +/** + * Request for uploading a certificate to the VKS. + * + * @see VKS API Documentation + */ public class UploadRequestDto { private static final byte[] ARMOR_HEADER = "-----BEGIN PGP PUBLIC KEY BLOCK-----".getBytes(Charset.forName("UTF8")); @@ -24,6 +29,15 @@ public class UploadRequestDto { this.keytext = keytext; } + /** + * Create an {@link UploadRequestDto} from an ASCII armored or binary OpenPGP certificate which is read from the + * given
certInStream
. + * + * @param certInStream {@link InputStream} containing the ASCII armored or binary OpenPGP certificate + * @return request DTO + * + * @throws IOException in case of an IO error + */ public static UploadRequestDto fromInputStream(InputStream certInStream) throws IOException { ByteArrayOutputStream certBuf = new ByteArrayOutputStream(); Streams.pipeAll(certInStream, certBuf); @@ -31,11 +45,26 @@ public class UploadRequestDto { return fromBytes(certBuf.toByteArray()); } + /** + * Create an {@link UploadRequestDto} from an ASCII armored or binary OpenPGP certificate which is read from the + * given
keytext
byte array. + * + * @param keytext byte array containing the ASCII armored or binary OpenPGP certificate + * @return request DTO + */ public static UploadRequestDto fromBytes(byte[] keytext) { String armoredOrBase64 = new String(base64IfNecessary(keytext)); return new UploadRequestDto(armoredOrBase64); } + /** + * Prepare a serialized OpenPGP certificate for upload. + * If the given
certBytes
contain an ASCII armored OpenPGP certificate, do nothing. + * Otherwise, consider the bytes to be the binary representation of an OpenPGP certificate and wrap it in Base64 encoding. + * + * @param certBytes certificate bytes + * @return Unmodified ASCII armored, or base64 encoded binary OpenPGP certificate + */ private static byte[] base64IfNecessary(byte[] certBytes) { if (!Arrays.areEqual(certBytes, 0, ARMOR_HEADER.length, ARMOR_HEADER, 0, ARMOR_HEADER.length)) { certBytes = Base64.encode(certBytes); diff --git a/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadResponseDto.java b/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadResponseDto.java index b2298c9..03d132b 100644 --- a/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadResponseDto.java +++ b/vks-java/src/main/java/pgp/vks/client/v1/dto/UploadResponseDto.java @@ -11,6 +11,11 @@ import pgp.vks.client.Upload; import java.util.HashMap; import java.util.Map; +/** + * The VKS servers response to a successful upload. + * + * @see VKS API Documentation + */ public class UploadResponseDto { private final String key_fpr; @@ -25,21 +30,41 @@ public class UploadResponseDto { this.token = token; } + /** + * Uppercase fingerprint of the uploaded OpenPGP certificate. + * + * @return fingerprint + */ @JsonProperty("key_fpr") public String getKeyFingerprint() { return key_fpr; } + /** + * Access token which can be used for a limited time to request verification emails for user-ids on the certificate. + * + * @return access token + */ @JsonProperty("token") public String getToken() { return token; } + /** + * Map of {@link Status States} of email addresses of user-ids on the certificate. + * + * @return email status map + */ @JsonProperty("status") public Map getStatus() { return new HashMap<>(status); } + /** + * Convert the DTO into an entity. + * + * @return entity + */ public Upload.Response toEntity() { return new Upload.Response(getKeyFingerprint(), getStatus(), getToken()); } diff --git a/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationRequestDto.java b/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationRequestDto.java index 999be64..47c2608 100644 --- a/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationRequestDto.java +++ b/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationRequestDto.java @@ -8,6 +8,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * Request for email verification of one or more unpublished/pending user-ids. + * + * @see VKS API Documentation + */ public class VerificationRequestDto { private final String token; @@ -22,16 +27,31 @@ public class VerificationRequestDto { this.locale = locale; } + /** + * Return the token which was previously required by uploading a certificate using an {@link UploadRequestDto}. + * + * @return access token used to authenticate the request + */ @JsonProperty("token") public String getToken() { return token; } + /** + * {@link List} of email addresses for which to request email verification. + * + * @return email addresses + */ @JsonProperty("addresses") public List getAddresses() { return addresses; } + /** + * {@link List} of preferred locales for the verification mails. + * + * @return locale list + */ @JsonProperty("locale") public List getLocale() { return locale; diff --git a/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationResponseDto.java b/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationResponseDto.java index 78a9597..bbd6e14 100644 --- a/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationResponseDto.java +++ b/vks-java/src/main/java/pgp/vks/client/v1/dto/VerificationResponseDto.java @@ -10,6 +10,11 @@ import pgp.vks.client.Status; import java.util.Map; +/** + * VKS servers response to a successful verification request. + * + * @see VKS API Documentation + */ public class VerificationResponseDto { private final String key_fpr; @@ -24,21 +29,41 @@ public class VerificationResponseDto { this.token = token; } + /** + * Uppercase OpenPGP fingerprint of the certificate. + * + * @return fingerprint + */ @JsonProperty("key_fpr") public String getKeyFingerprint() { return key_fpr; } + /** + * Access token which can be used to authenticate further verification requests. + * + * @return token + */ @JsonProperty("token") public String getToken() { return token; } + /** + * Map of {@link Status States} of email addresses of user-ids on the certificate. + * + * @return email address status map + */ @JsonProperty("status") public Map getStatus() { return status; } + /** + * Convert this DTO to an entity. + * + * @return entity + */ public RequestVerify.Response toEntity() { return new RequestVerify.Response(getKeyFingerprint(), getStatus(), getToken()); } From 661f7865f4d6170ddbb9f92c679324d5bc567de7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 11 Apr 2022 13:33:28 +0200 Subject: [PATCH 08/35] Update README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 5b6369b..7d8659d 100644 --- a/README.md +++ b/README.md @@ -9,3 +9,10 @@ SPDX-License-Identifier: Apache-2.0 Client-side API for fetching keys from - and publishing keys to - Verifying OpenPGP Key Servers (VKS). An example implementation of a Verifying Key Server is [Hagrid](https://gitlab.com/hagrid-keyserver/hagrid), which is running https://keys.openpgp.org. + +## Modules + +This repository contains the following modules: + +* [vks-java](/vks-java): Client-side Java API for communicating with VKS servers +* [vks-java-cli](/vks-java-cli): CLI frontend for `vks-java` From 635b88b093fb5d8fdf3a54a4efb63b4b3ee478d3 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 11 Apr 2022 13:33:41 +0200 Subject: [PATCH 09/35] Create CHANGELOG.md --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..71b8f3b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ + + +# Changelog + +## 0.1.0 +- Add `vks-java-cli`: CLI frontend for `vks-java` +- Bump Bouncy Castle dependencies to `1.71` + +## 0.1.0 +- Initial release + - `vks-java`: Client side API to communicate with Verifying Key Servers \ No newline at end of file From 702ea0016e9621eb481f0f5a683d1dade9381ea9 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 11 Apr 2022 13:34:47 +0200 Subject: [PATCH 10/35] VKS-Java 0.1.1 --- version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index c31b284..d67dc42 100644 --- a/version.gradle +++ b/version.gradle @@ -5,7 +5,7 @@ allprojects { ext { shortVersion = '0.1.1' - isSnapshot = true + isSnapshot = false minAndroidSdk = 10 javaSourceCompatibility = 1.8 junitVersion = '5.8.2' From f16abd3a5e4aa758893dee8c1254a8991c3b8769 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 11 Apr 2022 13:36:24 +0200 Subject: [PATCH 11/35] VKS-Java 0.1.2-SNAPSHOT --- version.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.gradle b/version.gradle index d67dc42..02cb6c0 100644 --- a/version.gradle +++ b/version.gradle @@ -4,8 +4,8 @@ allprojects { ext { - shortVersion = '0.1.1' - isSnapshot = false + shortVersion = '0.1.2' + isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 junitVersion = '5.8.2' From a35378e87068bbb0879c76ef02b311d00d19ec45 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 11 Apr 2022 13:54:24 +0200 Subject: [PATCH 12/35] Add command name and description for parent command --- vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java index c5cba18..b5b0df3 100644 --- a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java @@ -11,6 +11,8 @@ import picocli.CommandLine; import java.net.MalformedURLException; @CommandLine.Command( + name = "vks", + description = "Interact with Verifying Key Servers", subcommands = { CommandLine.HelpCommand.class, GetCmd.class, From 028daa6a739c678ccba9761a072935ffade89dfa Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Sat, 23 Apr 2022 02:02:34 +0200 Subject: [PATCH 13/35] CLI: Set keys.openpgp.org as default keyserver --- vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java index b5b0df3..dec9f39 100644 --- a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java @@ -22,7 +22,7 @@ import java.net.MalformedURLException; ) public class VKSCLI { - String keyServer; + String keyServer = "https://keys.openpgp.org"; public static void main(String[] args) { int exitCode = execute(args); From fd191c1bb4756bb89b78bdbc22bd1109bd5cc079 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 00:57:35 +0200 Subject: [PATCH 14/35] Bump slf4j to 1.7.36 --- version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index 02cb6c0..0aeb945 100644 --- a/version.gradle +++ b/version.gradle @@ -9,7 +9,7 @@ allprojects { minAndroidSdk = 10 javaSourceCompatibility = 1.8 junitVersion = '5.8.2' - slf4jVersion = '1.7.32' + slf4jVersion = '1.7.36' logbackVersion = '1.2.10' } } From ac101a14134b84474a7453724cd3b4470ec80eff Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 00:58:12 +0200 Subject: [PATCH 15/35] Bump logback to 1.2.11 --- version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index 0aeb945..7aba544 100644 --- a/version.gradle +++ b/version.gradle @@ -10,6 +10,6 @@ allprojects { javaSourceCompatibility = 1.8 junitVersion = '5.8.2' slf4jVersion = '1.7.36' - logbackVersion = '1.2.10' + logbackVersion = '1.2.11' } } From 29cfade707c7927717262339b6235720eec1d10b Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:00:32 +0200 Subject: [PATCH 16/35] Update changelog --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b8f3b..fac8a09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,13 @@ SPDX-License-Identifier: Apache-2.0 # Changelog -## 0.1.0 +## 0.1.2-SNAPSHOT +- Bump `slf4j` to `1.7.36` +- Bump `logback` to `1.2.11` +- CLI: Set `keys.openpgp.org` as default key server +- Add name and description to parent command + +## 0.1.1 - Add `vks-java-cli`: CLI frontend for `vks-java` - Bump Bouncy Castle dependencies to `1.71` From d82b22131f5e272426f848f90af71af166e0d810 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:03:43 +0200 Subject: [PATCH 17/35] Add documentation to build.gradle files --- vks-java-cli/build.gradle | 1 + vks-java/build.gradle | 1 + 2 files changed, 2 insertions(+) diff --git a/vks-java-cli/build.gradle b/vks-java-cli/build.gradle index 4e96ef4..92033bd 100644 --- a/vks-java-cli/build.gradle +++ b/vks-java-cli/build.gradle @@ -13,6 +13,7 @@ repositories { } dependencies { + // JUnit testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" diff --git a/vks-java/build.gradle b/vks-java/build.gradle index 1f0b6f1..4d166d2 100644 --- a/vks-java/build.gradle +++ b/vks-java/build.gradle @@ -13,6 +13,7 @@ repositories { } dependencies { + // JUnit testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" From 80ff3cf47a71bfa22886a7fc6495199a331a1aab Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:03:54 +0200 Subject: [PATCH 18/35] Bump lombok to 1.18.24 --- version.gradle | 1 + vks-java/build.gradle | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/version.gradle b/version.gradle index 7aba544..d37f2ea 100644 --- a/version.gradle +++ b/version.gradle @@ -11,5 +11,6 @@ allprojects { junitVersion = '5.8.2' slf4jVersion = '1.7.36' logbackVersion = '1.2.11' + lombokVersion = '1.18.24' } } diff --git a/vks-java/build.gradle b/vks-java/build.gradle index 4d166d2..adf3786 100644 --- a/vks-java/build.gradle +++ b/vks-java/build.gradle @@ -24,10 +24,10 @@ dependencies { implementation "com.google.code.findbugs:jsr305:3.0.2" // Lombok (@SneakyThrows...) - compileOnly 'org.projectlombok:lombok:1.18.22' - annotationProcessor 'org.projectlombok:lombok:1.18.22' - testCompileOnly 'org.projectlombok:lombok:1.18.22' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.22' + compileOnly "org.projectlombok:lombok:$lombokVersion" + annotationProcessor "org.projectlombok:lombok:$lombokVersion" + testCompileOnly "org.projectlombok:lombok:$lombokVersion" + testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion" // JSON implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2' From b1d3b42d396300fdd7da987d6c1679459ec81464 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:04:51 +0200 Subject: [PATCH 19/35] Move jackson databind version to version.gradle --- version.gradle | 1 + vks-java/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index d37f2ea..e8b82d7 100644 --- a/version.gradle +++ b/version.gradle @@ -12,5 +12,6 @@ allprojects { slf4jVersion = '1.7.36' logbackVersion = '1.2.11' lombokVersion = '1.18.24' + jacksonDataBindVersion = '2.13.2.2' } } diff --git a/vks-java/build.gradle b/vks-java/build.gradle index adf3786..b78415d 100644 --- a/vks-java/build.gradle +++ b/vks-java/build.gradle @@ -30,7 +30,7 @@ dependencies { testAnnotationProcessor "org.projectlombok:lombok:$lombokVersion" // JSON - implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2' + implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonDataBindVersion" } test { From 1def42b54bfe9181423ade72cb2e1c9ab6068a21 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:06:16 +0200 Subject: [PATCH 20/35] Move bouncycastle version to version.gradle --- version.gradle | 1 + vks-java/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index e8b82d7..ca45aed 100644 --- a/version.gradle +++ b/version.gradle @@ -8,6 +8,7 @@ allprojects { isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 + bouncycastleVersion = '1.71' junitVersion = '5.8.2' slf4jVersion = '1.7.36' logbackVersion = '1.2.11' diff --git a/vks-java/build.gradle b/vks-java/build.gradle index b78415d..d3cc1c8 100644 --- a/vks-java/build.gradle +++ b/vks-java/build.gradle @@ -18,7 +18,7 @@ dependencies { testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion" // Arrays.areEqual, Base64... - implementation("org.bouncycastle:bcutil-jdk15to18:1.71") + implementation "org.bouncycastle:bcutil-jdk15to18:$bouncycastleVersion" // @Nonnull, @Nullable... implementation "com.google.code.findbugs:jsr305:3.0.2" From 8aa68ccfb3e91934bcebaf9cdfee2c2201eb2f3b Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:07:04 +0200 Subject: [PATCH 21/35] Move jsr version to version.gradle --- version.gradle | 1 + vks-java/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index ca45aed..cb16165 100644 --- a/version.gradle +++ b/version.gradle @@ -10,6 +10,7 @@ allprojects { javaSourceCompatibility = 1.8 bouncycastleVersion = '1.71' junitVersion = '5.8.2' + jsrVersion = '3.0.2' slf4jVersion = '1.7.36' logbackVersion = '1.2.11' lombokVersion = '1.18.24' diff --git a/vks-java/build.gradle b/vks-java/build.gradle index d3cc1c8..61c30d2 100644 --- a/vks-java/build.gradle +++ b/vks-java/build.gradle @@ -21,7 +21,7 @@ dependencies { implementation "org.bouncycastle:bcutil-jdk15to18:$bouncycastleVersion" // @Nonnull, @Nullable... - implementation "com.google.code.findbugs:jsr305:3.0.2" + implementation "com.google.code.findbugs:jsr305:$jsrVersion" // Lombok (@SneakyThrows...) compileOnly "org.projectlombok:lombok:$lombokVersion" From 03354a18a6df4ab216bac00363748323d1008545 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:08:04 +0200 Subject: [PATCH 22/35] Move picocli version to version.gradle --- version.gradle | 1 + vks-java-cli/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index cb16165..c303882 100644 --- a/version.gradle +++ b/version.gradle @@ -14,6 +14,7 @@ allprojects { slf4jVersion = '1.7.36' logbackVersion = '1.2.11' lombokVersion = '1.18.24' + picocliVersion = '4.6.3' jacksonDataBindVersion = '2.13.2.2' } } diff --git a/vks-java-cli/build.gradle b/vks-java-cli/build.gradle index 92033bd..bf714f8 100644 --- a/vks-java-cli/build.gradle +++ b/vks-java-cli/build.gradle @@ -21,7 +21,7 @@ dependencies { implementation project(":vks-java") // CLI - implementation "info.picocli:picocli:4.6.3" + implementation "info.picocli:picocli:$picocliVersion" } application { From 6074feff9b8ea510ebb9c6d3d380051e501935d7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Tue, 26 Apr 2022 01:08:59 +0200 Subject: [PATCH 23/35] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fac8a09..a729e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ SPDX-License-Identifier: Apache-2.0 ## 0.1.2-SNAPSHOT - Bump `slf4j` to `1.7.36` - Bump `logback` to `1.2.11` +- Bump `lombok` to `1.18.24` - CLI: Set `keys.openpgp.org` as default key server - Add name and description to parent command From 327d2166485f510d5adad2dd6241a5023179d4f8 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 29 Apr 2022 16:40:59 +0200 Subject: [PATCH 24/35] VKS-Java 0.1.2 --- CHANGELOG.md | 2 +- version.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a729e32..b7fc49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 # Changelog -## 0.1.2-SNAPSHOT +## 0.1.2 - Bump `slf4j` to `1.7.36` - Bump `logback` to `1.2.11` - Bump `lombok` to `1.18.24` diff --git a/version.gradle b/version.gradle index c303882..5451036 100644 --- a/version.gradle +++ b/version.gradle @@ -5,7 +5,7 @@ allprojects { ext { shortVersion = '0.1.2' - isSnapshot = true + isSnapshot = false minAndroidSdk = 10 javaSourceCompatibility = 1.8 bouncycastleVersion = '1.71' From 0a21cec1d30700ad268e802e8fd6775ff973d714 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 29 Apr 2022 16:44:42 +0200 Subject: [PATCH 25/35] VKS-Java 0.1.3-SNAPSHOT --- version.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.gradle b/version.gradle index 5451036..d7522b0 100644 --- a/version.gradle +++ b/version.gradle @@ -4,8 +4,8 @@ allprojects { ext { - shortVersion = '0.1.2' - isSnapshot = false + shortVersion = '0.1.3' + isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 bouncycastleVersion = '1.71' From 867eebe6849a6ae42a6c0860347ffb579dc03630 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 1 Aug 2022 17:25:21 +0200 Subject: [PATCH 26/35] Add woodpecker CI --- .reuse/dep5 | 5 +++++ .woodpecker/.build.yml | 12 ++++++++++++ .woodpecker/.reuse.yml | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 .woodpecker/.build.yml create mode 100644 .woodpecker/.reuse.yml diff --git a/.reuse/dep5 b/.reuse/dep5 index b8bb6be..b613adc 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -13,3 +13,8 @@ Source: https://pgpainless.org Files: gradle* Copyright: 2015 the original author or authors. License: Apache-2.0 + +# Woodpecker build files +Files: .woodpecker/* +Copyright: 2022 the original author or authors. +License: Apache-2.0 diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml new file mode 100644 index 0000000..f504b44 --- /dev/null +++ b/.woodpecker/.build.yml @@ -0,0 +1,12 @@ +pipeline: + run: + image: gradle:7.5-jdk8 + commands: + - git checkout $CI_COMMIT_BRANCH + # Code works + - gradle test + # Code is clean + - gradle check javadocAll + # Code has coverage + - gradle jacocoRootReport coveralls + secrets: [COVERALLS_REPO_TOKEN] diff --git a/.woodpecker/.reuse.yml b/.woodpecker/.reuse.yml new file mode 100644 index 0000000..58f17e6 --- /dev/null +++ b/.woodpecker/.reuse.yml @@ -0,0 +1,7 @@ +# Code is licensed properly +# See https://reuse.software/ +pipeline: + reuse: + image: fsfe/reuse:latest + commands: + - reuse lint \ No newline at end of file From f349c701fac8dc3cfccdeae9277854e8d164e280 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Mon, 1 Aug 2022 17:28:44 +0200 Subject: [PATCH 27/35] Add badges for CI and Coveralls --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 7d8659d..7a6897f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ SPDX-License-Identifier: Apache-2.0 # Verifying Key Server - Client API for Java +[![status-badge](https://ci.codeberg.org/api/badges/PGPainless/vks-java/status.svg)](https://ci.codeberg.org/PGPainless/vks-java) +[![Coverage Status](https://coveralls.io/repos/github/pgpainless/vks-java/badge.svg?branch=main)](https://coveralls.io/github/pgpainless/vks-java?branch=main) +[![REUSE status](https://api.reuse.software/badge/github.com/pgpainless/vks-java)](https://api.reuse.software/info/github.com/pgpainless/vks-java) + Client-side API for fetching keys from - and publishing keys to - Verifying OpenPGP Key Servers (VKS). An example implementation of a Verifying Key Server is [Hagrid](https://gitlab.com/hagrid-keyserver/hagrid), which is running https://keys.openpgp.org. From e37921b4d445938f6e0faf7a094a6425f6af1dae Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 4 Aug 2022 00:49:08 +0200 Subject: [PATCH 28/35] Add support for i18n using resource bundles --- .../main/java/pgp/vks/client/cli/GetCmd.java | 20 +++++++++++---- .../client/cli/RequestVerificationCmd.java | 24 ++++++++++++------ .../java/pgp/vks/client/cli/UploadCmd.java | 25 +++++++++++++------ .../main/java/pgp/vks/client/cli/VKSCLI.java | 14 ++++++----- .../src/main/resources/msg_get.properties | 9 +++++++ .../src/main/resources/msg_get_de.properties | 12 +++++++++ .../src/main/resources/msg_help.properties | 5 ++++ .../src/main/resources/msg_help_de.properties | 6 +++++ .../msg_request_verification.properties | 11 ++++++++ .../msg_request_verification_de.properties | 14 +++++++++++ .../src/main/resources/msg_upload.properties | 8 ++++++ .../main/resources/msg_upload_de.properties | 11 ++++++++ .../src/main/resources/msg_vks.properties | 6 +++++ .../src/main/resources/msg_vks_de.properties | 6 +++++ 14 files changed, 145 insertions(+), 26 deletions(-) create mode 100644 vks-java-cli/src/main/resources/msg_get.properties create mode 100644 vks-java-cli/src/main/resources/msg_get_de.properties create mode 100644 vks-java-cli/src/main/resources/msg_help.properties create mode 100644 vks-java-cli/src/main/resources/msg_help_de.properties create mode 100644 vks-java-cli/src/main/resources/msg_request_verification.properties create mode 100644 vks-java-cli/src/main/resources/msg_request_verification_de.properties create mode 100644 vks-java-cli/src/main/resources/msg_upload.properties create mode 100644 vks-java-cli/src/main/resources/msg_upload_de.properties create mode 100644 vks-java-cli/src/main/resources/msg_vks.properties create mode 100644 vks-java-cli/src/main/resources/msg_vks_de.properties diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java index 7f1fa9f..43ea165 100644 --- a/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/GetCmd.java @@ -11,8 +11,12 @@ import picocli.CommandLine; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; +import java.util.Locale; +import java.util.ResourceBundle; -@CommandLine.Command(name = "get", description = "Retrieve an OpenPGP certificate from the key server") +@CommandLine.Command( + name = "get", + resourceBundle = "msg_get") public class GetCmd implements Runnable { @CommandLine.Mixin @@ -22,16 +26,22 @@ public class GetCmd implements Runnable { Exclusive by; static class Exclusive { - @CommandLine.Option(names = {"-f", "--by-fingerprint"}, description = "Retrieve a key by its fingerprint (NOT prefixed with '0x')") + @CommandLine.Option(names = {"-f", "--by-fingerprint"}) String fingerprint; - @CommandLine.Option(names = {"-i", "--by-keyid"}, description = "Retrieve a key by its decimal key ID or that of one of its subkeys.") + @CommandLine.Option(names = {"-i", "--by-keyid"}) Long keyId; - @CommandLine.Option(names = {"-e", "--by-email"}, description = "Retrieve a key by email address.") + @CommandLine.Option(names = {"-e", "--by-email"}) String email; } + private final ResourceBundle msg; + + public GetCmd() { + msg = ResourceBundle.getBundle("msg_get", Locale.getDefault()); + } + public void run() { VKS vks; try { @@ -50,7 +60,7 @@ public class GetCmd implements Runnable { } else if (by.email != null) { inputStream = get.byEmail(by.email); } else { - throw new IllegalArgumentException("Missing --by-* option."); + throw new IllegalArgumentException(msg.getString("error.missing_by_option")); } int read; diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java index 6767f7d..2fba390 100644 --- a/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/RequestVerificationCmd.java @@ -12,23 +12,32 @@ import java.io.IOException; import java.net.MalformedURLException; import java.util.Arrays; import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; -@CommandLine.Command(name = "request-verification", description = "Request verification for unverified user-ids") +@CommandLine.Command( + name = "request-verification", + resourceBundle = "msg_request_verification") public class RequestVerificationCmd implements Runnable { @CommandLine.Mixin VKSCLI.KeyServerMixin keyServerMixin; - @CommandLine.Option(names = {"-t", "--token"}, description = "Access token. Can be retrieved by uploading the certificate.", + @CommandLine.Option(names = {"-t", "--token"}, required = true, arity = "1", paramLabel = "TOKEN") String token; - @CommandLine.Option(names = {"-l", "--locale"}, description = "Locale for the verification mail") + @CommandLine.Option(names = {"-l", "--locale"}) List locale = Arrays.asList("en_US", "en_GB"); - @CommandLine.Option(names = {"-e", "--email"}, description = "Email addresses to request a verification mail for", required = true, arity = "1..*") + @CommandLine.Option(names = {"-e", "--email"}, required = true, arity = "1..*") String[] addresses = new String[0]; + private final ResourceBundle msg; + + public RequestVerificationCmd() { + msg = ResourceBundle.getBundle("msg_request_verification", Locale.getDefault()); + } @Override public void run() { @@ -44,10 +53,9 @@ public class RequestVerificationCmd implements Runnable { RequestVerify.Response response = requestVerify .forEmailAddresses(addresses) .execute(token, locale); - - System.out.println("Verification E-Mails for key " + response.getKeyFingerprint() + " have been sent."); - System.out.println("Token: " + response.getToken()); - System.out.println("Status:"); + System.out.printf(msg.getString("output.mails_sent"), response.getKeyFingerprint()); + System.out.printf(msg.getString("output.token"), response.getToken()); + System.out.println(msg.getString("output.status")); for (String address : response.getStatus().keySet()) { System.out.println("\t" + address + "\t" + response.getStatus().get(address)); } diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java index cba61bb..c3927bc 100644 --- a/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/UploadCmd.java @@ -15,17 +15,26 @@ import java.io.IOException; import java.net.MalformedURLException; import java.util.ArrayList; import java.util.List; +import java.util.Locale; +import java.util.ResourceBundle; -@CommandLine.Command(name = "upload", description = "Upload an OpenPGP certificate to the key server") +@CommandLine.Command( + name = "upload", + resourceBundle = "msg_upload") public class UploadCmd implements Runnable { @CommandLine.Mixin VKSCLI.KeyServerMixin keyServerMixin; - @CommandLine.Option(names = {"-r", "--request-verification"}, - description = "Request verification mails for unpublished email addresses") + @CommandLine.Option(names = {"-r", "--request-verification"}) boolean requestVerification; + private final ResourceBundle msg; + + public UploadCmd() { + msg = ResourceBundle.getBundle("msg_upload", Locale.getDefault()); + } + public void run() { VKS vks; try { @@ -51,11 +60,13 @@ public class UploadCmd implements Runnable { } } - System.out.println("Uploaded key " + response.getKeyFingerprint()); - System.out.println("Token: " + response.getToken()); + String msgUpload = String.format(msg.getString("output.uploaded_key"), + response.getKeyFingerprint(), response.getToken()); + System.out.println(msgUpload); + String msgStatus = msg.getString("output.status"); if (!requestVerification || unpublished.isEmpty()) { - System.out.println("Status:"); + System.out.println(msgStatus); for (String address : response.getStatus().keySet()) { Status status = response.getStatus().get(address); System.out.format("%-" + maxMailLen + "s %s\n", address, status); @@ -65,7 +76,7 @@ public class UploadCmd implements Runnable { RequestVerify.Response verifyResponse = vks.requestVerification().forEmailAddresses(unpublished.toArray(new String[0])) .execute(response.getToken()); - System.out.println("Status:"); + System.out.println(msgStatus); for (String address : verifyResponse.getStatus().keySet()) { Status status = response.getStatus().get(address); System.out.format("%-" + maxMailLen + "s %s\n", address, status); diff --git a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java index dec9f39..142e192 100644 --- a/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java +++ b/vks-java-cli/src/main/java/pgp/vks/client/cli/VKSCLI.java @@ -9,10 +9,12 @@ import pgp.vks.client.VKSImpl; import picocli.CommandLine; import java.net.MalformedURLException; +import java.util.Locale; +import java.util.ResourceBundle; @CommandLine.Command( name = "vks", - description = "Interact with Verifying Key Servers", + resourceBundle = "msg_vks", subcommands = { CommandLine.HelpCommand.class, GetCmd.class, @@ -32,14 +34,15 @@ public class VKSCLI { } public static int execute(String[] args) { - return new CommandLine(VKSCLI.class) - .setExitCodeExceptionMapper(new CommandLine.IExitCodeExceptionMapper() { + CommandLine cmd = new CommandLine(VKSCLI.class); + cmd.setExitCodeExceptionMapper(new CommandLine.IExitCodeExceptionMapper() { @Override public int getExitCode(Throwable exception) { return 1; } - }) - .setCommandName("vkscli") + }); + cmd.getSubcommands().get("help").setResourceBundle(ResourceBundle.getBundle("msg_help", Locale.getDefault())); + return cmd.setCommandName("vkscli") .execute(args); } @@ -53,7 +56,6 @@ public class VKSCLI { VKSCLI parent; @CommandLine.Option(names = "--key-server", - description = "Address of the Verifying Key Server.\nDefaults to 'https://keys.openpgp.org'", paramLabel = "KEYSERVER") public void setKeyServer(String keyServer) { parent.keyServer = keyServer; diff --git a/vks-java-cli/src/main/resources/msg_get.properties b/vks-java-cli/src/main/resources/msg_get.properties new file mode 100644 index 0000000..70ab33d --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_get.properties @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Retrieve an OpenPGP certificate from the key server +by-fingerprint=Retrieve a key by its fingerprint (NOT prefixed with '0x') +by-keyid=Retrieve a key by its decimal key ID or that of one of its subkeys +by-email=Retrieve a key by email address +error.missing_by_option=Missing --by-* option. +key-server=Address of the Verifying Key Server.%nDefaults to 'https://keys.openpgp.org' diff --git a/vks-java-cli/src/main/resources/msg_get_de.properties b/vks-java-cli/src/main/resources/msg_get_de.properties new file mode 100644 index 0000000..b13c717 --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_get_de.properties @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Empfange ein OpenPGP Zertifikat vom Schlüsselserver +by-fingerprint=Finde das Zertifikat anhand seines Fingerabdrucks (OHNE Präfix '0x') +by-keyid=Finde das Zertifikat anhand seiner Schlüssel-ID oder der eines seiner Unterschlüssel +by-email=Finde das Zertifikat anhand einer E-Mail-Adresse +error.missing_by_option=Fehlende --by-* Option. +usage.synopsisHeading=Nutzung:\u0020 +usage.optionListHeading=Optionen:%n + +key-server=Adresse des verifizierenden Schlüsselservers.%nStandardmäßig: 'https://keys.openpgp.org' diff --git a/vks-java-cli/src/main/resources/msg_help.properties b/vks-java-cli/src/main/resources/msg_help.properties new file mode 100644 index 0000000..f288ae3 --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_help.properties @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Displays help information about the specified command +usage.synopsisHeading=Usage:\u0020 diff --git a/vks-java-cli/src/main/resources/msg_help_de.properties b/vks-java-cli/src/main/resources/msg_help_de.properties new file mode 100644 index 0000000..304bb42 --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_help_de.properties @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Zeige Hilfetext für den angegebenen Befehl +usage.synopsisHeading=Nutzung:\u0020 +usage.optionListHeading=Optionen:%n diff --git a/vks-java-cli/src/main/resources/msg_request_verification.properties b/vks-java-cli/src/main/resources/msg_request_verification.properties new file mode 100644 index 0000000..b8d64ae --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_request_verification.properties @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Request verification for unverified user-ids +token=Access token. Can be retrieved by uploading the certificate. +locale=Locale (language) for the verification mail +email=Email addresses to request a verification mail for +output.mails_sent=Verification E-Mails for certificate %s have been sent.%n +output.token=Token: %s%n +output.status=Status: +key-server=Address of the Verifying Key Server.%nDefaults to 'https://keys.openpgp.org' diff --git a/vks-java-cli/src/main/resources/msg_request_verification_de.properties b/vks-java-cli/src/main/resources/msg_request_verification_de.properties new file mode 100644 index 0000000..773630c --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_request_verification_de.properties @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Fordere Verifikation von unveröffentlichten Nutzeridentitäten an +token=Zugangstoken. Kann durch das Hochladen des Zertifikates erhalten werden. +locale=Gebietsschema (Sprache) für die E-Mail-Verifikation +email=E-Mail-Adresse für die eine Verifikation angefragt werden soll +output.mails_sent=E-Mail-Verifikationen für Zertifikat %s wurden versendet.%n%n +output.token=Zugangstoken: %s%n +output.status=Status: +usage.synopsisHeading=Nutzung:\u0020 +usage.optionListHeading=Optionen:%n + +key-server=Adresse des verifizierenden Schlüsselservers.%nStandardmäßig: 'https://keys.openpgp.org' diff --git a/vks-java-cli/src/main/resources/msg_upload.properties b/vks-java-cli/src/main/resources/msg_upload.properties new file mode 100644 index 0000000..d2fa507 --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_upload.properties @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Upload an OpenPGP certificate to the key server +request-verification=Request verification mails for unpublished email addresses +output.uploaded_key=Uploaded key: %s%nToken: %s +output.status=Status: +key-server=Address of the Verifying Key Server.%nDefaults to 'https://keys.openpgp.org' diff --git a/vks-java-cli/src/main/resources/msg_upload_de.properties b/vks-java-cli/src/main/resources/msg_upload_de.properties new file mode 100644 index 0000000..cb38d3d --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_upload_de.properties @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Lade ein OpenPGP Zertifikat auf den Schlüsselserver hoch +request-verification=Fordere E-Mailverifikation für unveröffentlichte E-Mail-Adressen an +output.uploaded_key=Hochgeladenes Zertifikat: %s%nToken: %s +output.status=Status: +usage.synopsisHeading=Nutzung:\u0020 +usage.optionListHeading=Optionen:%n + +key-server=Adresse des verifizierenden Schlüsselservers.%nStandardmäßig: 'https://keys.openpgp.org' diff --git a/vks-java-cli/src/main/resources/msg_vks.properties b/vks-java-cli/src/main/resources/msg_vks.properties new file mode 100644 index 0000000..5ba0b01 --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_vks.properties @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Interact with Verifying Key Servers +usage.synopsisHeading=Usage:\u0020 +usage.commandListHeading=Commands:%n diff --git a/vks-java-cli/src/main/resources/msg_vks_de.properties b/vks-java-cli/src/main/resources/msg_vks_de.properties new file mode 100644 index 0000000..5b3099d --- /dev/null +++ b/vks-java-cli/src/main/resources/msg_vks_de.properties @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2022 Paul Schaub +# +# SPDX-License-Identifier: Apache-2.0 +usage.header=Interagiere mit verifizierenden Schlüsselservern +usage.synopsisHeading=Nutzung:\u0020 +usage.commandListHeading=Befehle:%n From 1d65b4b3c219a6f980ffbfe61518b15024712ede Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 25 Nov 2022 15:54:05 +0100 Subject: [PATCH 29/35] Bump bc-util to 1.72 --- version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index d7522b0..9ca88d9 100644 --- a/version.gradle +++ b/version.gradle @@ -8,7 +8,7 @@ allprojects { isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 - bouncycastleVersion = '1.71' + bouncycastleVersion = '1.72' junitVersion = '5.8.2' jsrVersion = '3.0.2' slf4jVersion = '1.7.36' From ec59e717fcffe8d160b5426a16e9da98ae1bb818 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 25 Nov 2022 15:54:46 +0100 Subject: [PATCH 30/35] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7fc49b..a0f02a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ SPDX-License-Identifier: Apache-2.0 # Changelog +## 0.1.3-SNAPSHOT +- Bump `bc-util` to `1.72` +- Add support for resource bundles for i18n + ## 0.1.2 - Bump `slf4j` to `1.7.36` - Bump `logback` to `1.2.11` From 09f45e86db60e961d2228ac759f90d31d3f5f3f0 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 7 Jul 2023 12:43:21 +0200 Subject: [PATCH 31/35] Bump jackson-databind to 2.15.2 --- version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index 9ca88d9..6aa27fe 100644 --- a/version.gradle +++ b/version.gradle @@ -15,6 +15,6 @@ allprojects { logbackVersion = '1.2.11' lombokVersion = '1.18.24' picocliVersion = '4.6.3' - jacksonDataBindVersion = '2.13.2.2' + jacksonDataBindVersion = '2.15.2' } } From 3f68ae57259074a1443f5b5e938f6f20f7900872 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 7 Jul 2023 12:44:00 +0200 Subject: [PATCH 32/35] Bump bcpg to 1.75 --- version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle b/version.gradle index 6aa27fe..0788c5c 100644 --- a/version.gradle +++ b/version.gradle @@ -8,7 +8,7 @@ allprojects { isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 - bouncycastleVersion = '1.72' + bouncycastleVersion = '1.75' junitVersion = '5.8.2' jsrVersion = '3.0.2' slf4jVersion = '1.7.36' From 23cc79aaa8145555eb42d7cd3ab573f32e77cdd2 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 7 Jul 2023 12:45:48 +0200 Subject: [PATCH 33/35] Update changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f02a9..91e6339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 # Changelog ## 0.1.3-SNAPSHOT -- Bump `bc-util` to `1.72` +- Bump `bc-util` to `1.75` +- Bump `jackson-databind` to `2.15.2` - Add support for resource bundles for i18n ## 0.1.2 @@ -23,4 +24,4 @@ SPDX-License-Identifier: Apache-2.0 ## 0.1.0 - Initial release - - `vks-java`: Client side API to communicate with Verifying Key Servers \ No newline at end of file + - `vks-java`: Client side API to communicate with Verifying Key Servers From 32a2909c53edda0cd9dbdf78bd450e9dbf2ac946 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 7 Jul 2023 12:47:27 +0200 Subject: [PATCH 34/35] VKS-Java 0.1.3 --- CHANGELOG.md | 2 +- version.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e6339..2f77f3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 # Changelog -## 0.1.3-SNAPSHOT +## 0.1.3 - Bump `bc-util` to `1.75` - Bump `jackson-databind` to `2.15.2` - Add support for resource bundles for i18n diff --git a/version.gradle b/version.gradle index 0788c5c..db852c2 100644 --- a/version.gradle +++ b/version.gradle @@ -5,7 +5,7 @@ allprojects { ext { shortVersion = '0.1.3' - isSnapshot = true + isSnapshot = false minAndroidSdk = 10 javaSourceCompatibility = 1.8 bouncycastleVersion = '1.75' From 57434d80cf9dbabde5301f9f9ea9bb514d76a9c7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 7 Jul 2023 12:48:59 +0200 Subject: [PATCH 35/35] VKS-Java 0.1.4-SNAPSHOT --- version.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.gradle b/version.gradle index db852c2..c9d1def 100644 --- a/version.gradle +++ b/version.gradle @@ -4,8 +4,8 @@ allprojects { ext { - shortVersion = '0.1.3' - isSnapshot = false + shortVersion = '0.1.4' + isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8 bouncycastleVersion = '1.75'