Skip to content

Commit

Permalink
Remove alg parameter from RecipientInterface.apply().
Browse files Browse the repository at this point in the history
  • Loading branch information
dajiaji committed Jun 24, 2021
1 parent afdcb7a commit c424492
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,8 @@ Changes
Unreleased
----------

- Remove alg parameter from RecipientInterface.apply(). `#141 <https://github.com/dajiaji/python-cwt/pull/141>`__

Version 1.0.0
--------------

Expand Down
1 change: 0 additions & 1 deletion cwt/recipient_algs/aes_key_wrap.py
Expand Up @@ -39,7 +39,6 @@ def apply(
self,
key: Optional[COSEKeyInterface] = None,
recipient_key: Optional[COSEKeyInterface] = None,
alg: Optional[int] = None,
context: Optional[Union[List[Any], Dict[str, Any]]] = None,
) -> COSEKeyInterface:
if not key:
Expand Down
1 change: 0 additions & 1 deletion cwt/recipient_algs/direct_hkdf.py
Expand Up @@ -80,7 +80,6 @@ def apply(
self,
key: Optional[COSEKeyInterface] = None,
recipient_key: Optional[COSEKeyInterface] = None,
alg: Optional[int] = None,
context: Optional[Union[List[Any], Dict[str, Any]]] = None,
) -> COSEKeyInterface:

Expand Down
1 change: 0 additions & 1 deletion cwt/recipient_algs/direct_key.py
Expand Up @@ -21,7 +21,6 @@ def apply(
self,
key: Optional[COSEKeyInterface] = None,
recipient_key: Optional[COSEKeyInterface] = None,
alg: Optional[int] = None,
context: Optional[Union[List[Any], Dict[str, Any]]] = None,
) -> COSEKeyInterface:
if not key:
Expand Down
1 change: 0 additions & 1 deletion cwt/recipient_algs/ecdh_aes_key_wrap.py
Expand Up @@ -53,7 +53,6 @@ def apply(
self,
key: Optional[COSEKeyInterface] = None,
recipient_key: Optional[COSEKeyInterface] = None,
alg: Optional[int] = None,
context: Optional[Union[List[Any], Dict[str, Any]]] = None,
) -> COSEKeyInterface:

Expand Down
1 change: 0 additions & 1 deletion cwt/recipient_algs/ecdh_direct_hkdf.py
Expand Up @@ -50,7 +50,6 @@ def apply(
self,
key: Optional[COSEKeyInterface] = None,
recipient_key: Optional[COSEKeyInterface] = None,
alg: Optional[int] = None,
context: Optional[Union[List[Any], Dict[str, Any]]] = None,
) -> COSEKeyInterface:

Expand Down
2 changes: 0 additions & 2 deletions cwt/recipient_interface.py
Expand Up @@ -144,7 +144,6 @@ def apply(
self,
key: Optional[COSEKeyInterface] = None,
recipient_key: Optional[COSEKeyInterface] = None,
alg: Optional[int] = None,
context: Optional[Union[List[Any], Dict[str, Any]]] = None,
) -> COSEKeyInterface:
"""
Expand All @@ -162,7 +161,6 @@ def apply(
be used for preparing the key.
recipient_key (Optional[COSEKeyInterface]): The external public
key provided by the recipient used for ECDH key agreement.
alg (Optional[int]): The algorithm of the key to be generated.
context (Optional[Union[List[Any], Dict[str, Any]]]): Context
information structure.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_recipient_algs_aes_key_wrap.py
Expand Up @@ -116,7 +116,7 @@ def test_aes_key_wrap_apply_with_invalid_key(self):
{1: -3}, {}, sender_key=COSEKey.from_symmetric_key(alg="A128KW")
)
with pytest.raises(EncodeError) as err:
ctx.apply(key, alg="A128GCM")
ctx.apply(key, context={"alg": "A128GCM"})
pytest.fail("apply() should fail.")
assert "Failed to wrap key." in str(err.value)

Expand Down

0 comments on commit c424492

Please sign in to comment.