mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 12:52:07 +01:00
Add EncryptionOptions.addRecipients(PGPPublicKeyRingCollection)
This commit is contained in:
parent
e67854310d
commit
8e6abe5d02
1 changed files with 14 additions and 0 deletions
|
@ -26,6 +26,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
|
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator;
|
import org.bouncycastle.openpgp.operator.PBEKeyEncryptionMethodGenerator;
|
||||||
import org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator;
|
import org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator;
|
||||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
|
@ -104,6 +105,19 @@ public class EncryptionOptions {
|
||||||
return new EncryptionOptions(EncryptionStream.Purpose.STORAGE);
|
return new EncryptionOptions(EncryptionStream.Purpose.STORAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add all key rings in the provided key ring collection as recipients.
|
||||||
|
*
|
||||||
|
* @param keys keys
|
||||||
|
* @return this
|
||||||
|
*/
|
||||||
|
public EncryptionOptions addRecipients(PGPPublicKeyRingCollection keys) {
|
||||||
|
for (PGPPublicKeyRing key : keys) {
|
||||||
|
addRecipient(key);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a recipient by providing a key and recipient user-id.
|
* Add a recipient by providing a key and recipient user-id.
|
||||||
* The user-id is used to determine the recipients preferences (algorithms etc.).
|
* The user-id is used to determine the recipients preferences (algorithms etc.).
|
||||||
|
|
Loading…
Reference in a new issue