mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 12:52:07 +01:00
Modify API
This commit is contained in:
parent
5378a2e388
commit
626c4b14eb
2 changed files with 15 additions and 0 deletions
|
@ -179,6 +179,19 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
|
||||||
return this;
|
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,
|
public <O> WithAlgorithms andToSelf(PublicKeyRingSelectionStrategy<O> ringSelectionStrategy,
|
||||||
MultiMap<O, PGPPublicKeyRingCollection> keys) {
|
MultiMap<O, PGPPublicKeyRingCollection> keys) {
|
||||||
if (keys.isEmpty()) {
|
if (keys.isEmpty()) {
|
||||||
|
|
|
@ -59,6 +59,8 @@ public interface EncryptionBuilderInterface {
|
||||||
|
|
||||||
WithAlgorithms andToSelf(PGPPublicKeyRing... keys);
|
WithAlgorithms andToSelf(PGPPublicKeyRing... keys);
|
||||||
|
|
||||||
|
WithAlgorithms andToSelf(PGPPublicKeyRingCollection keys);
|
||||||
|
|
||||||
<O> WithAlgorithms andToSelf(PublicKeyRingSelectionStrategy<O> selectionStrategy,
|
<O> WithAlgorithms andToSelf(PublicKeyRingSelectionStrategy<O> selectionStrategy,
|
||||||
MultiMap<O, PGPPublicKeyRingCollection> keys);
|
MultiMap<O, PGPPublicKeyRingCollection> keys);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue