mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-10 06:11:08 +01:00
KeyRingInfo.isUsableFor*(): Check if primary key is revoked
This commit is contained in:
parent
c1de66e1d7
commit
ca09ac62ca
2 changed files with 49 additions and 1 deletions
|
|
@ -1048,10 +1048,14 @@ public class KeyRingInfo {
|
|||
* @return true if usable for encryption
|
||||
*/
|
||||
public boolean isUsableForEncryption(@Nonnull EncryptionPurpose purpose) {
|
||||
return !getEncryptionSubkeys(purpose).isEmpty();
|
||||
return isKeyValidlyBound(getKeyId()) && !getEncryptionSubkeys(purpose).isEmpty();
|
||||
}
|
||||
|
||||
public boolean isUsableForSigning() {
|
||||
if (!isKeyValidlyBound(getKeyId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
List<PGPPublicKey> signingKeys = getSigningSubkeys();
|
||||
for (PGPPublicKey pk : signingKeys) {
|
||||
PGPSecretKey sk = getSecretKey(pk.getKeyID());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue