diff --git a/CHANGELOG.md b/CHANGELOG.md index 787c372..e2e320a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,9 @@ SPDX-License-Identifier: CC0-1.0 # Cert-D-PGPainless Changelog -## 0.2.0 +## 0.1.3-SNAPSHOT - `get`: Apply `toLowerCase()` to fingerprints - Use BCs `PGPPublicKeyRing.join(first, second)` method to properly merge certificates -- Implement storing of `trust-root` key -- Bump `cert-d-java` to `0.2.1` -- Changes to CLI - - Add support for i18n using resource bundles - - Rename `import` command to `insert` - - Rename `multi-import` command to `import` - - Add `export` command - - Add basic `list` command - - `get` command: Allow querying by special name - - Add armor headers to output of `get` command ## 0.1.2 - Add name and description to main command diff --git a/README.md b/README.md index 4535866..e7e9981 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,7 @@ SPDX-License-Identifier: Apache-2.0 [![Coverage Status](https://coveralls.io/repos/github/pgpainless/cert-d-pgpainless/badge.svg?branch=main)](https://coveralls.io/github/pgpainless/cert-d-pgpainless?branch=main) [![REUSE status](https://api.reuse.software/badge/github.com/pgpainless/cert-d-pgpainless)](https://api.reuse.software/info/github.com/pgpainless/cert-d-pgpainless) -This repository contains implementations of the [Shared PGP Certificate Directory](https://sequoia-pgp.gitlab.io/pgp-cert-d/) -specification using [PGPainless](https://pgpainless.org) as backend. +This repository contains implementations of the [Shared PGP Certificate Directory](https://sequoia-pgp.gitlab.io/pgp-cert-d/) specification using [PGPainless](https://pgpainless.org) as backend. The module `pgpainless-cert-d` can be used as a drop-in implementation of `pgp-certificate-store`. diff --git a/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Import.java b/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Import.java index 5306d24..3dfcfb4 100644 --- a/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Import.java +++ b/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Import.java @@ -33,9 +33,6 @@ public class Import implements Runnable { ByteArrayInputStream certIn = new ByteArrayInputStream(cert.getEncoded()); Certificate certificate = PGPCertDCli.getCertificateDirectory() .insert(certIn, MergeCallbacks.mergeWithExisting()); - // CHECKSTYLE:OFF - System.out.println(certificate.getFingerprint()); - // CHECKSTYLE:ON } } catch (IOException e) { LOGGER.error("IO-Error.", e); diff --git a/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Insert.java b/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Insert.java index cf62fd8..25987d0 100644 --- a/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Insert.java +++ b/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Insert.java @@ -25,9 +25,6 @@ public class Insert implements Runnable { try { Certificate certificate = PGPCertDCli.getCertificateDirectory() .insert(System.in, MergeCallbacks.mergeWithExisting()); - // CHECKSTYLE:OFF - System.out.println(certificate.getFingerprint()); - // CHECKSTYLE:ON } catch (IOException e) { LOGGER.error("IO-Error.", e); System.exit(-1); diff --git a/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Setup.java b/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Setup.java index 070c284..2cdc5c4 100644 --- a/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Setup.java +++ b/pgpainless-cert-d-cli/src/main/java/pgp/cert_d/cli/commands/Setup.java @@ -17,7 +17,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.pgpainless.certificate_store.MergeCallbacks; import pgp.cert_d.cli.PGPCertDCli; -import pgp.certificate_store.certificate.KeyMaterial; import pgp.certificate_store.exception.BadDataException; import picocli.CommandLine; @@ -62,11 +61,7 @@ public class Setup implements Runnable { try { InputStream inputStream = new ByteArrayInputStream(trustRoot.getEncoded()); - KeyMaterial inserted = PGPCertDCli.getCertificateDirectory() - .insertTrustRoot(inputStream, MergeCallbacks.overrideExisting()); - // CHECKSTYLE:OFF - System.out.println(inserted.getFingerprint()); - // CHECKSTYLE:ON + PGPCertDCli.getCertificateDirectory().insertTrustRoot(inputStream, MergeCallbacks.overrideExisting()); } catch (BadDataException e) { throw new RuntimeException(e); diff --git a/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/MergeCallbacks.java b/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/MergeCallbacks.java index 000e935..cbd3a44 100644 --- a/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/MergeCallbacks.java +++ b/pgpainless-cert-d/src/main/java/org/pgpainless/certificate_store/MergeCallbacks.java @@ -16,7 +16,6 @@ import pgp.certificate_store.certificate.KeyMaterialMerger; import pgp.certificate_store.exception.BadDataException; import java.io.IOException; -import java.util.Arrays; import java.util.Iterator; public class MergeCallbacks { @@ -108,7 +107,7 @@ public class MergeCallbacks { } } - private void printOutDifferences(PGPKeyRing existingCert, PGPKeyRing mergedCert) throws IOException { + private void printOutDifferences(PGPKeyRing existingCert, PGPKeyRing mergedCert) { int numSigsBefore = countSigs(existingCert); int numSigsAfter = countSigs(mergedCert); int newSigs = numSigsAfter - numSigsBefore; @@ -116,7 +115,7 @@ public class MergeCallbacks { int numUidsAfter = count(mergedCert.getPublicKey().getUserIDs()); int newUids = numUidsAfter - numUidsBefore; - if (!Arrays.equals(existingCert.getEncoded(), mergedCert.getEncoded())) { + if (!existingCert.equals(mergedCert)) { OpenPgpFingerprint fingerprint = OpenPgpFingerprint.of(mergedCert); StringBuilder sb = new StringBuilder(); sb.append(String.format("Certificate %s has", fingerprint)); diff --git a/version.gradle b/version.gradle index 024bca2..d7f242e 100644 --- a/version.gradle +++ b/version.gradle @@ -4,7 +4,7 @@ allprojects { ext { - shortVersion = '0.2.1' + shortVersion = '0.1.3' isSnapshot = true minAndroidSdk = 10 javaSourceCompatibility = 1.8