Skip to content

Commit 5e2cbe9

Browse files
committed
Added new function (new_sym_key)
1 parent 80ef1f4 commit 5e2cbe9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cryptojwt/jwk/hmac.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23

34
from .utils import sha256_digest
45
from .utils import sha384_digest
@@ -139,3 +140,7 @@ def __eq__(self, other):
139140
return False
140141

141142
return True
143+
144+
145+
def new_sym_key(use='', bytes=24, kid=''):
146+
return SYMKey(use=use, kid=kid, key=as_unicode(os.urandom(bytes)))

0 commit comments

Comments
 (0)