Skip to content

Commit 8b8fcfb

Browse files
committed
Documentation changes.
1 parent d7156a7 commit 8b8fcfb

File tree

8 files changed

+20
-22
lines changed

8 files changed

+20
-22
lines changed

doc/source/jwk.rst

-8
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,6 @@ cryptojwt\.jwk\.jwk module
3636
:undoc-members:
3737
:show-inheritance:
3838

39-
cryptojwt\.jwk\.jwks module
40-
---------------------------
41-
42-
.. automodule:: cryptojwt.jwk.jwks
43-
:members:
44-
:undoc-members:
45-
:show-inheritance:
46-
4739
cryptojwt\.jwk\.rsa module
4840
--------------------------
4941

src/cryptojwt/jwe/jwe.py

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class JWE(JWx):
6363

6464
def encrypt(self, keys=None, cek="", iv="", **kwargs):
6565
"""
66+
Encrypt a payload
6667
6768
:param keys: A set of possibly usable keys
6869
:param cek: Content master key

src/cryptojwt/jwe/jwe_ec.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,14 @@ def dec_setup(self, token, key=None, **kwargs):
180180

181181
def encrypt(self, key=None, iv="", cek="", **kwargs):
182182
"""
183+
Produces a JWE as defined in RFC7516 using an Elliptic curve key
183184
184185
:param key: *Not used>, only there to present the same API as
185186
JWE_RSA and JWE_SYM
186-
:param iv:
187-
:param cek:
188-
:param kwargs:
189-
:return:
187+
:param iv: Initialization vector
188+
:param cek: Content master key
189+
:param kwargs: Extra keyword arguments
190+
:return: An encrypted JWT
190191
"""
191192
_msg = as_bytes(self.msg)
192193

src/cryptojwt/jwe/jwe_hmac.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ class JWE_SYM(JWEKey):
2424

2525
def encrypt(self, key, iv="", cek="", **kwargs):
2626
"""
27+
Produces a JWE as defined in RFC7516 using symmetric keys
2728
2829
:param key: Shared symmetric key
29-
:param iv: initialization vector
30-
:param cek:
30+
:param iv: Initialization vector
31+
:param cek: Content master key
3132
:param kwargs: Extra keyword arguments, just ignore for now.
3233
:return:
3334
"""

src/cryptojwt/jwe/jwe_rsa.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ class JWE_RSA(JWEKey):
2121

2222
def encrypt(self, key, iv="", cek="", **kwargs):
2323
"""
24-
Produces a JWE using RSA algorithms
24+
Produces a JWE as defined in RFC7516 using RSA algorithms
2525
2626
:param key: RSA key
27-
:param context:
28-
:param iv:
29-
:param cek:
30-
:return: A jwe
27+
:param iv: Initialization vector
28+
:param cek: Content master key
29+
:param kwargs: Extra keyword arguments
30+
:return: A signed payload
3131
"""
3232

3333
_msg = as_bytes(self.msg)

src/cryptojwt/jws/hmac.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def __init__(self, algorithm='SHA256'):
2222

2323
def sign(self, msg, key):
2424
"""
25-
Create a signature over a message
25+
Create a signature over a message as defined in RFC7515 using a
26+
symmetric key
2627
2728
:param msg: The message
2829
:param key: The key

src/cryptojwt/jws/rsa.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ def __init__(self, algorithm='RS256'):
1212
(self.hash, self.padding) = parse_rsa_algorithm(algorithm)
1313

1414
def sign(self, msg, key):
15-
"""Computes the signature for message.
15+
"""
16+
Create a signature over a message as defined in RFC7515 using an
17+
RSA key
1618
1719
:param msg: the message.
1820
:type msg: bytes

src/cryptojwt/key_bundle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ def key_diff(key_bundle, key_defs):
787787
:param key_bundle: The original KeyBundle
788788
:param key_defs: A set of key definitions
789789
:return: A dictionary with possible keys 'add' and 'del'. The values
790-
for the keys are lists of :py:class:`cryptojwt.jwk.JWK` instances
790+
for the keys are lists of :py:class:`cryptojwt.jwk.JWK` instances
791791
"""
792792

793793
keys = key_bundle.get()

0 commit comments

Comments
 (0)