mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-16 17:32:06 +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
|
@Override
|
||||||
public @Nonnull PGPSignature getSignatureWithPreferences() {
|
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) {
|
if (signature != null) {
|
||||||
return signature;
|
return signature;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue