1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-23 03:17:58 +01:00

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

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