mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-23 03:17:58 +01:00
KeyAccessor.ViaKeyId: Differentiate between primary key (direct-key sig) and subkey
This commit is contained in:
parent
b44a97760a
commit
c7dc7f755c
1 changed files with 7 additions and 1 deletions
|
@ -110,7 +110,13 @@ public abstract class KeyAccessor {
|
|||
|
||||
@Override
|
||||
public @Nonnull PGPSignature getSignatureWithPreferences() {
|
||||
PGPSignature signature = info.getLatestDirectKeySelfSignature();
|
||||
PGPSignature signature;
|
||||
if (key.getPrimaryKeyId() != key.getSubkeyId()) {
|
||||
signature = info.getCurrentSubkeyBindingSignature(key.getSubkeyId());
|
||||
} else {
|
||||
signature = info.getLatestDirectKeySelfSignature();
|
||||
}
|
||||
|
||||
if (signature != null) {
|
||||
return signature;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue