Add get{,Un}HashedNotationData(sig, notationName) to SignatureSubpacketUtils

This commit is contained in:
Paul Schaub 2021-06-10 13:35:55 +02:00
parent bedfef49fe
commit f7525dde65
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 22 additions and 0 deletions

View File

@ -331,6 +331,17 @@ public class SignatureSubpacketsUtil {
return Arrays.asList(notations);
}
public static List<NotationData> getHashedNotationData(PGPSignature signature, String notationName) {
List<NotationData> allNotations = getHashedNotationData(signature);
List<NotationData> withName = new ArrayList<>();
for (NotationData data : allNotations) {
if (data.getNotationName().equals(notationName)) {
withName.add(data);
}
}
return withName;
}
/**
* Return the notation data subpackets from the signatures unhashed area.
*
@ -342,6 +353,17 @@ public class SignatureSubpacketsUtil {
return Arrays.asList(notations);
}
public static List<NotationData> getUnhashedNotationData(PGPSignature signature, String notationName) {
List<NotationData> allNotations = getUnhashedNotationData(signature);
List<NotationData> withName = new ArrayList<>();
for (NotationData data : allNotations) {
if (data.getNotationName().equals(notationName)) {
withName.add(data);
}
}
return withName;
}
/**
* Return the revocation key subpacket from the signatures hashed area.
*