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

Modify API

This commit is contained in:
Paul Schaub 2018-07-08 18:05:55 +02:00
parent 5378a2e388
commit 626c4b14eb
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 15 additions and 0 deletions

View file

@ -179,6 +179,19 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
return this;
}
@Override
public WithAlgorithms andToSelf(PGPPublicKeyRingCollection keys) {
for (PGPPublicKeyRing ring : keys) {
for (Iterator<PGPPublicKey> i = ring.getPublicKeys(); i.hasNext(); ) {
PGPPublicKey key = i.next();
if (encryptionKeySelector().accept(null, key)) {
EncryptionBuilder.this.encryptionKeys.add(key);
}
}
}
return this;
}
public <O> WithAlgorithms andToSelf(PublicKeyRingSelectionStrategy<O> ringSelectionStrategy,
MultiMap<O, PGPPublicKeyRingCollection> keys) {
if (keys.isEmpty()) {

View file

@ -59,6 +59,8 @@ public interface EncryptionBuilderInterface {
WithAlgorithms andToSelf(PGPPublicKeyRing... keys);
WithAlgorithms andToSelf(PGPPublicKeyRingCollection keys);
<O> WithAlgorithms andToSelf(PublicKeyRingSelectionStrategy<O> selectionStrategy,
MultiMap<O, PGPPublicKeyRingCollection> keys);