Package org.pgpainless.util
Class SessionKey
- java.lang.Object
-
- org.pgpainless.util.SessionKey
-
public class SessionKey extends Object
ASessionKey
is the symmetric key that is used to encrypt/decrypt an OpenPGP message. The OpenPGP message header contains a copy of the session key, encrypted for the public key of each recipient.
-
-
Constructor Summary
Constructors Constructor Description SessionKey(org.bouncycastle.openpgp.PGPSessionKey sessionKey)
Constructor to create a session key from a BCPGPSessionKey
object.SessionKey(SymmetricKeyAlgorithm algorithm, byte[] key)
Create a session key object from an algorithm and a key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SymmetricKeyAlgorithm
getAlgorithm()
Return the symmetric key algorithm.byte[]
getKey()
Return the bytes of the key.
-
-
-
Constructor Detail
-
SessionKey
public SessionKey(@Nonnull org.bouncycastle.openpgp.PGPSessionKey sessionKey)
Constructor to create a session key from a BCPGPSessionKey
object.- Parameters:
sessionKey
- BC session key
-
SessionKey
public SessionKey(@Nonnull SymmetricKeyAlgorithm algorithm, @Nonnull byte[] key)
Create a session key object from an algorithm and a key.- Parameters:
algorithm
- algorithmkey
- key
-
-
Method Detail
-
getAlgorithm
public SymmetricKeyAlgorithm getAlgorithm()
Return the symmetric key algorithm.- Returns:
- algorithm
-
getKey
public byte[] getKey()
Return the bytes of the key.- Returns:
- key
-
-