Skip to content

Commit 4fb616e

Browse files
committed
Can be interesting to know how many keys there are in the key jar.
1 parent 8f483c0 commit 4fb616e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cryptojwt/key_jar.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,14 @@ def copy(self):
630630
kj.httpc = self.httpc
631631
return kj
632632

633+
def __len__(self):
634+
keys = 0
635+
for iss in list(self.owners()):
636+
for kb in self.issuer_keys[iss]:
637+
if len(kb):
638+
keys += len(kb)
639+
return keys
640+
633641

634642
# =============================================================================
635643

0 commit comments

Comments
 (0)