mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-05 03:41:07 +01:00
Add OpenPGPKey.isFullyDecrypted/isFullyEncrypted extension methods
This commit is contained in:
parent
fc056edd93
commit
cd99330a97
1 changed files with 8 additions and 0 deletions
|
|
@ -27,3 +27,11 @@ fun OpenPGPKey.getSecretKeyFor(pkesk: PGPPublicKeyEncryptedData): OpenPGPSecretK
|
|||
*/
|
||||
fun OpenPGPSecretKey.unlock(passphrase: Passphrase): OpenPGPPrivateKey =
|
||||
this.unlock(passphrase.getChars())
|
||||
|
||||
fun OpenPGPKey.isFullyDecrypted(): Boolean {
|
||||
return secretKeys.values.none { it.isLocked }
|
||||
}
|
||||
|
||||
fun OpenPGPKey.isFullyEncrypted(): Boolean {
|
||||
return secretKeys.values.all { it.isLocked }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue