From 8ff405d6ad7ff72c2ad4ccb2edf38bd8b7794467 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 24 Mar 2022 14:16:13 +0100 Subject: [PATCH] Add toString() to SessionKey --- .../src/main/java/org/pgpainless/util/SessionKey.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java b/pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java index 397e1f0a..1e71bb03 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java +++ b/pgpainless-core/src/main/java/org/pgpainless/util/SessionKey.java @@ -7,6 +7,7 @@ package org.pgpainless.util; import javax.annotation.Nonnull; import org.bouncycastle.openpgp.PGPSessionKey; +import org.bouncycastle.util.encoders.Hex; import org.pgpainless.algorithm.SymmetricKeyAlgorithm; /** @@ -57,4 +58,9 @@ public class SessionKey { System.arraycopy(key, 0, copy, 0, copy.length); return copy; } + + @Override + public String toString() { + return "" + getAlgorithm().getAlgorithmId() + ":" + Hex.toHexString(getKey()); + } }