diff --git a/src/commonMain/kotlin/net/sergeych/crypto2/Container.kt b/src/commonMain/kotlin/net/sergeych/crypto2/Container.kt index c018f24..b19328f 100644 --- a/src/commonMain/kotlin/net/sergeych/crypto2/Container.kt +++ b/src/commonMain/kotlin/net/sergeych/crypto2/Container.kt @@ -153,14 +153,27 @@ sealed class Container { } } + /** + * Add one or more recipients to the __decrypted__ container using a standard builder. Note that + * [Builder.fill] is not working in this case. + */ fun addRecipients(builder: Builder.() -> Unit): Container = if (this is Single) asOpenMulti.addRecipients(builder) else { Builder(this).apply(builder).build() } + /** + * Add e key to the __decrypted__ container + */ operator fun plus(recipient: Asymmetric.PublicKey) = addRecipients { key(recipient) } + /** + * Add e key to the __decrypted__ container + */ operator fun plus(recipient: EncryptingKey) = addRecipients { key(recipient) } + /** + * Add e sender -> recipient asymmetric keys pair key to the __decrypted__ container + */ operator fun plus(pair: Pair) = addRecipients { key(pair) } /**