diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-08-12 00:04:25 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 18:34:25 +0000 |
commit | 8f7e4a405e0b6f2fd969c1fe3027b8f6b066c156 (patch) | |
tree | 732f6dcc9e60104320ac78d034f6594ab3618a4d /crypto-pgpainless/src/main | |
parent | ef0613b59869ae3523bae89af3fb1625c220f2a0 (diff) |
Upgrade all dependencies (#2057)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Diffstat (limited to 'crypto-pgpainless/src/main')
-rw-r--r-- | crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/KeyUtils.kt | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/KeyUtils.kt b/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/KeyUtils.kt index 586603fd..47c06c4f 100644 --- a/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/KeyUtils.kt +++ b/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/KeyUtils.kt @@ -10,7 +10,7 @@ import app.passwordstore.crypto.GpgIdentifier.UserId import com.github.michaelbull.result.get import com.github.michaelbull.result.runCatching import org.bouncycastle.openpgp.PGPKeyRing -import org.pgpainless.PGPainless +import org.pgpainless.key.parsing.KeyRingReader /** Utility methods to deal with [PGPKey]s. */ public object KeyUtils { @@ -19,15 +19,7 @@ public object KeyUtils { * then as a public one before the method gives up and returns null. */ public fun tryParseKeyring(key: PGPKey): PGPKeyRing? { - val secKeyRing = runCatching { PGPainless.readKeyRing().secretKeyRing(key.contents) }.get() - if (secKeyRing != null) { - return secKeyRing - } - val pubKeyRing = runCatching { PGPainless.readKeyRing().publicKeyRing(key.contents) }.get() - if (pubKeyRing != null) { - return pubKeyRing - } - return null + return runCatching { KeyRingReader.readKeyRing(key.contents.inputStream()) }.get() } /** Parses a [PGPKeyRing] from the given [key] and calculates its long key ID */ |