From c0317dda47f32e7d16163c04dc9f7d38e0c4d782 Mon Sep 17 00:00:00 2001 From: sergeych Date: Wed, 19 Jun 2024 20:22:55 +0700 Subject: [PATCH] missing docs --- .../kotlin/net/sergeych/crypto2/Container.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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) } /**