diff --git a/jwcrypto/jwk.py b/jwcrypto/jwk.py index 66ba6f2..99d6d43 100644 --- a/jwcrypto/jwk.py +++ b/jwcrypto/jwk.py @@ -274,7 +274,7 @@ class JWK(dict): """ def __init__(self, **kwargs): - """Creates a new JWK object. + r"""Creates a new JWK object. The function arguments must be valid parameters as defined in the 'IANA JSON Web Key Set Parameters registry' and specified in @@ -299,6 +299,8 @@ def __init__(self, **kwargs): valid key type as value then a new key will be generated according to the defaults or provided key strength options (type specific). + :param \**kwargs: parameters (otional). + :raises InvalidJWKType: if the key type is invalid :raises InvalidJWKValue: if incorrect or inconsistent parameters are provided. @@ -1107,6 +1109,10 @@ def __setitem__(self, item, value): super(JWK, self).__setitem__(item, value) def update(self, *args, **kwargs): + r""" + :param \*args: arguments + :param \**kwargs: keyword arguments + """ for k, v in dict(*args, **kwargs).items(): self.__setitem__(k, v) @@ -1233,6 +1239,10 @@ def __setitem__(self, key, val): super(JWKSet, self).__setitem__(key, val) def update(self, *args, **kwargs): + r""" + :param \*args: arguments + :param \**kwargs: keyword arguments + """ for k, v in dict(*args, **kwargs).items(): self.__setitem__(k, v) diff --git a/jwcrypto/jws.py b/jwcrypto/jws.py index 5c17b38..fb04518 100644 --- a/jwcrypto/jws.py +++ b/jwcrypto/jws.py @@ -106,7 +106,7 @@ def __init__(self, alg, key, header, payload, algs=None): :param payload(bytes): An arbitrary value :param algs: An optional list of allowed algorithms - :raises ValueError: if the key is not a :class:`JWK` object + :raises ValueError: if the key is not a (:class:`jwcrypto.jwk.JWK`) :raises InvalidJWAAlgorithm: if the algorithm is not valid, is unknown or otherwise not yet implemented. :raises InvalidJWSOperation: if the algorithm is not allowed. @@ -477,7 +477,7 @@ def add_signature(self, key, alg=None, protected=None, header=None): :param header: The Unprotected Header (optional) :raises InvalidJWSObject: if invalid headers are provided. - :raises ValueError: if the key is not a :class:`JWK` object. + :raises ValueError: if the key is not a (:class:`jwcrypto.jwk.JWK`) :raises ValueError: if the algorithm is missing or is not provided by one of the headers. :raises InvalidJWAAlgorithm: if the algorithm is not valid, is