mirror of
https://codeberg.org/PGPainless/cert-d-pgpainless.git
synced 2024-12-21 21:07:57 +01:00
Print out fingerprints when inserting|importing keys
This commit is contained in:
parent
f109b598f6
commit
47e9f5f08a
3 changed files with 12 additions and 1 deletions
|
@ -33,6 +33,9 @@ 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);
|
||||
|
|
|
@ -25,6 +25,9 @@ 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);
|
||||
|
|
|
@ -17,6 +17,7 @@ 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;
|
||||
|
||||
|
@ -61,7 +62,11 @@ public class Setup implements Runnable {
|
|||
|
||||
try {
|
||||
InputStream inputStream = new ByteArrayInputStream(trustRoot.getEncoded());
|
||||
PGPCertDCli.getCertificateDirectory().insertTrustRoot(inputStream, MergeCallbacks.overrideExisting());
|
||||
KeyMaterial inserted = PGPCertDCli.getCertificateDirectory()
|
||||
.insertTrustRoot(inputStream, MergeCallbacks.overrideExisting());
|
||||
// CHECKSTYLE:OFF
|
||||
System.out.println(inserted.getFingerprint());
|
||||
// CHECKSTYLE:ON
|
||||
|
||||
} catch (BadDataException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
Loading…
Reference in a new issue