1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 04:42:06 +01:00

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

View file

@ -331,6 +331,17 @@ public class SignatureSubpacketsUtil {
return Arrays.asList(notations); 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. * Return the notation data subpackets from the signatures unhashed area.
* *
@ -342,6 +353,17 @@ public class SignatureSubpacketsUtil {
return Arrays.asList(notations); 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. * Return the revocation key subpacket from the signatures hashed area.
* *