Skip to content

Commit 10ac93f

Browse files
committed
fix(jwe): auto add kid when add_recipient
1 parent 224e72a commit 10ac93f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/joserfc/_rfc7516/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class GeneralJSONEncryption(BaseJSONEncryption):
156156

157157
def add_recipient(self, header: Header | None = None, key: Key | None = None) -> None:
158158
recipient = Recipient(self, header, key)
159+
if key:
160+
key.ensure_kid()
161+
recipient.set_kid(t.cast(str, key.kid))
159162
self.recipients.append(recipient)
160163

161164

0 commit comments

Comments
 (0)