mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-26 22:32:07 +01:00
Fix KeyAccessor.ViaKeyId sourcing primary user-id signature
This commit is contained in:
parent
e177dafd60
commit
b58bdf8ff1
1 changed files with 5 additions and 10 deletions
|
@ -110,18 +110,13 @@ public abstract class KeyAccessor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nonnull PGPSignature getSignatureWithPreferences() {
|
public @Nonnull PGPSignature getSignatureWithPreferences() {
|
||||||
PGPSignature signature;
|
String primaryUserId = info.getPrimaryUserId();
|
||||||
if (key.getPrimaryKeyId() != key.getSubkeyId()) {
|
// If the key is located by Key ID, the algorithm of the primary User ID of the key provides the
|
||||||
signature = info.getCurrentSubkeyBindingSignature(key.getSubkeyId());
|
// preferred symmetric algorithm.
|
||||||
} else {
|
PGPSignature signature = info.getLatestUserIdCertification(primaryUserId);
|
||||||
|
if (signature == null) {
|
||||||
signature = info.getLatestDirectKeySelfSignature();
|
signature = info.getLatestDirectKeySelfSignature();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (signature != null) {
|
|
||||||
return signature;
|
|
||||||
}
|
|
||||||
|
|
||||||
signature = info.getLatestUserIdCertification(info.getPrimaryUserId());
|
|
||||||
if (signature == null) {
|
if (signature == null) {
|
||||||
throw new IllegalStateException("No valid signature found.");
|
throw new IllegalStateException("No valid signature found.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue