Bump PGPainless dependencies

Bump pgpainless-core to 1.5.6
Bump cert-d-pgpainless to 0.2.2
Bump cert-d-java to 0.2.2
This commit is contained in:
Paul Schaub 2023-07-07 12:34:16 +02:00
parent df2e4fb61e
commit 873ca84af8
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 12 additions and 9 deletions

View file

@ -7,9 +7,9 @@ SPDX-License-Identifier: Apache-2.0
# Changelog # Changelog
## 0.1.2-SNAPSHOT ## 0.1.2-SNAPSHOT
- Bump `pgpainless-core` to `1.13.2` - Bump `pgpainless-core` to `1.5.6`
- Bump `cert-d-pgpainless` to `0.2.1` - Bump `cert-d-pgpainless` to `0.2.2`
- Bump `cert-d-java` to `0.2.1` - Bump `cert-d-java` to `0.2.2`
## 0.1.1 ## 0.1.1
- Bump `pgpainless-core` to `1.2.1` - Bump `pgpainless-core` to `1.2.1`

View file

@ -16,10 +16,10 @@ allprojects {
slf4jVersion = '1.7.36' slf4jVersion = '1.7.36'
logbackVersion = '1.2.11' logbackVersion = '1.2.11'
mockitoVersion = '4.5.1' mockitoVersion = '4.5.1'
pgpainlessVersion = '1.3.12' pgpainlessVersion = '1.5.6'
pgpainlessCertDVersion = '0.2.1' pgpainlessCertDVersion = '0.2.2'
picocliVersion = '4.6.3' picocliVersion = '4.6.3'
certDJavaVersion = '0.2.1' certDJavaVersion = '0.2.2'
zbase32Version = '1.0.0' zbase32Version = '1.0.0'
} }
} }

View file

@ -6,9 +6,9 @@ package pgp.wkd.cli;
import org.bouncycastle.openpgp.PGPException; import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKeyRing; import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.pgpainless.PGPainless; import org.pgpainless.PGPainless;
import org.pgpainless.certificate_store.CertificateFactory; import org.pgpainless.certificate_store.CertificateFactory;
import org.pgpainless.key.collection.PGPKeyRingCollection;
import org.pgpainless.key.info.KeyRingInfo; import org.pgpainless.key.info.KeyRingInfo;
import pgp.certificate_store.certificate.Certificate; import pgp.certificate_store.certificate.Certificate;
import pgp.wkd.CertificateAndUserIds; import pgp.wkd.CertificateAndUserIds;
@ -24,8 +24,11 @@ public class PGPainlessCertificateParser implements CertificateParser {
public List<CertificateAndUserIds> read(InputStream inputStream) throws IOException { public List<CertificateAndUserIds> read(InputStream inputStream) throws IOException {
List<CertificateAndUserIds> certificatesAndUserIds = new ArrayList<>(); List<CertificateAndUserIds> certificatesAndUserIds = new ArrayList<>();
try { try {
PGPPublicKeyRingCollection certificates = PGPainless.readKeyRing().publicKeyRingCollection(inputStream); PGPKeyRingCollection keyMaterial = PGPainless.readKeyRing().keyRingCollection(inputStream, true);
for (PGPPublicKeyRing certificate : certificates) { if (keyMaterial.getPGPSecretKeyRingCollection().size() != 0) {
throw new PGPException("Secret key material encountered!");
}
for (PGPPublicKeyRing certificate : keyMaterial.getPgpPublicKeyRingCollection()) {
KeyRingInfo info = PGPainless.inspectKeyRing(certificate); KeyRingInfo info = PGPainless.inspectKeyRing(certificate);
Certificate parsedCert = CertificateFactory.certificateFromPublicKeyRing(certificate, 0L); Certificate parsedCert = CertificateFactory.certificateFromPublicKeyRing(certificate, 0L);
List<String> userIds = info.getValidAndExpiredUserIds(); List<String> userIds = info.getValidAndExpiredUserIds();