mirror of
https://codeberg.org/PGPainless/cert-d-pgpainless.git
synced 2024-12-22 05:17:56 +01:00
Compare certs based on encoding
This commit is contained in:
parent
76a5a91fe0
commit
f109b598f6
1 changed files with 3 additions and 2 deletions
|
@ -16,6 +16,7 @@ import pgp.certificate_store.certificate.KeyMaterialMerger;
|
||||||
import pgp.certificate_store.exception.BadDataException;
|
import pgp.certificate_store.exception.BadDataException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
public class MergeCallbacks {
|
public class MergeCallbacks {
|
||||||
|
@ -107,7 +108,7 @@ public class MergeCallbacks {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printOutDifferences(PGPKeyRing existingCert, PGPKeyRing mergedCert) {
|
private void printOutDifferences(PGPKeyRing existingCert, PGPKeyRing mergedCert) throws IOException {
|
||||||
int numSigsBefore = countSigs(existingCert);
|
int numSigsBefore = countSigs(existingCert);
|
||||||
int numSigsAfter = countSigs(mergedCert);
|
int numSigsAfter = countSigs(mergedCert);
|
||||||
int newSigs = numSigsAfter - numSigsBefore;
|
int newSigs = numSigsAfter - numSigsBefore;
|
||||||
|
@ -115,7 +116,7 @@ public class MergeCallbacks {
|
||||||
int numUidsAfter = count(mergedCert.getPublicKey().getUserIDs());
|
int numUidsAfter = count(mergedCert.getPublicKey().getUserIDs());
|
||||||
int newUids = numUidsAfter - numUidsBefore;
|
int newUids = numUidsAfter - numUidsBefore;
|
||||||
|
|
||||||
if (!existingCert.equals(mergedCert)) {
|
if (!Arrays.equals(existingCert.getEncoded(), mergedCert.getEncoded())) {
|
||||||
OpenPgpFingerprint fingerprint = OpenPgpFingerprint.of(mergedCert);
|
OpenPgpFingerprint fingerprint = OpenPgpFingerprint.of(mergedCert);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append(String.format("Certificate %s has", fingerprint));
|
sb.append(String.format("Certificate %s has", fingerprint));
|
||||||
|
|
Loading…
Reference in a new issue