Add toString() to SessionKey

This commit is contained in:
Paul Schaub 2022-03-24 14:16:13 +01:00
parent 405c7225f6
commit 8ff405d6ad
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 6 additions and 0 deletions

View File

@ -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());
}
}