mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-09 18:29:39 +02:00
Simplify SessionKey conversion
This commit is contained in:
parent
7b32da722f
commit
aa4ffbaba5
1 changed files with 4 additions and 7 deletions
|
@ -69,13 +69,10 @@ class DecryptImpl(private val api: PGPainless) : Decrypt {
|
|||
val verificationList =
|
||||
metadata.verifiedInlineSignatures.map { VerificationHelper.mapVerification(it) }
|
||||
|
||||
var sessionKey: SessionKey? = null
|
||||
if (metadata.sessionKey != null) {
|
||||
sessionKey =
|
||||
SessionKey(
|
||||
metadata.sessionKey!!.algorithm.algorithmId.toByte(),
|
||||
metadata.sessionKey!!.key)
|
||||
}
|
||||
val sessionKey: SessionKey? =
|
||||
metadata.sessionKey?.let {
|
||||
SessionKey(it.algorithm.algorithmId.toByte(), it.key)
|
||||
}
|
||||
return DecryptionResult(sessionKey, verificationList)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue