From 54d83daee580766cee4d3613dee9b058179a1a8a Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 2 Apr 2025 15:27:49 +0200 Subject: [PATCH] Port UnlockSecretKey method --- .../kotlin/org/pgpainless/key/protection/UnlockSecretKey.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/UnlockSecretKey.kt b/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/UnlockSecretKey.kt index f83b8336..dd2f7081 100644 --- a/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/UnlockSecretKey.kt +++ b/pgpainless-core/src/main/kotlin/org/pgpainless/key/protection/UnlockSecretKey.kt @@ -111,5 +111,9 @@ class UnlockSecretKey { secretKey, SecretKeyRingProtector.unlockSingleKeyWith(passphrase, secretKey)) } } + + @JvmStatic + fun unlockSecretKey(secretKey: OpenPGPSecretKey, passphrase: Passphrase): OpenPGPPrivateKey = + unlockSecretKey(secretKey, SecretKeyRingProtector.unlockAnyKeyWith(passphrase)) } }