mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-26 12:58:02 +01:00
parent
a8ab93a49a
commit
15f6cc70b1
1 changed files with 15 additions and 0 deletions
|
@ -92,6 +92,21 @@ public class MessageMetadata {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list containing all recipient keyIDs.
|
||||
*
|
||||
* @return list of recipients
|
||||
*/
|
||||
public List<Long> getRecipientKeyIds() {
|
||||
List<Long> keyIds = new ArrayList<>();
|
||||
Iterator<EncryptedData> encLayers = getEncryptionLayers();
|
||||
while (encLayers.hasNext()) {
|
||||
EncryptedData layer = encLayers.next();
|
||||
keyIds.addAll(layer.getRecipients());
|
||||
}
|
||||
return keyIds;
|
||||
}
|
||||
|
||||
public @Nonnull Iterator<EncryptedData> getEncryptionLayers() {
|
||||
return new LayerIterator<EncryptedData>(message) {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue