mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-23 11:27:57 +01:00
SecretKeyRingEditor: Take not only positive, but also generic,casual certifications into consideration
This commit is contained in:
parent
c942238b40
commit
17ba3c3879
1 changed files with 5 additions and 2 deletions
|
@ -416,12 +416,15 @@ public class SecretKeyRingEditor implements SecretKeyRingEditorInterface {
|
||||||
Iterator<PGPSignature> keySignatures = subjectPubKey.getSignaturesForKeyID(primaryKey.getKeyID());
|
Iterator<PGPSignature> keySignatures = subjectPubKey.getSignaturesForKeyID(primaryKey.getKeyID());
|
||||||
while (keySignatures.hasNext()) {
|
while (keySignatures.hasNext()) {
|
||||||
PGPSignature next = keySignatures.next();
|
PGPSignature next = keySignatures.next();
|
||||||
if (next.getSignatureType() == PGPSignature.POSITIVE_CERTIFICATION) {
|
SignatureType type = SignatureType.valueOf(next.getSignatureType());
|
||||||
|
if (type == SignatureType.POSITIVE_CERTIFICATION ||
|
||||||
|
type == SignatureType.CASUAL_CERTIFICATION ||
|
||||||
|
type == SignatureType.GENERIC_CERTIFICATION) {
|
||||||
oldSignature = next;
|
oldSignature = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (oldSignature == null) {
|
if (oldSignature == null) {
|
||||||
throw new IllegalStateException("Key " + new OpenPgpV4Fingerprint(subjectPubKey) + " does not have a previous positive signature.");
|
throw new IllegalStateException("Key " + new OpenPgpV4Fingerprint(subjectPubKey) + " does not have a previous positive/casual/generic certification signature.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Iterator<PGPSignature> bindingSignatures = subjectPubKey.getSignaturesOfType(SignatureType.SUBKEY_BINDING.getCode());
|
Iterator<PGPSignature> bindingSignatures = subjectPubKey.getSignaturesOfType(SignatureType.SUBKEY_BINDING.getCode());
|
||||||
|
|
Loading…
Reference in a new issue