diff --git a/jwcrypto/jwk.py b/jwcrypto/jwk.py index 8db4c07..168fb5c 100644 --- a/jwcrypto/jwk.py +++ b/jwcrypto/jwk.py @@ -370,15 +370,15 @@ def generate_key(self, **params): @classmethod def generate_similar(cls, key): - return cls.generate(**key.get_generate_params()) + return cls.generate(**key.get_generate_params()) def get_generate_params(self): - params = {param: self.get(param) for param in ["kty", "crv", "use", "key_ops"] if param in self} - if self.get("kty") == "RSA": - params["size"] = self._get_public_key().key_size - elif self.get("kty") == "oct": - params["size"] = len(base64url_decode(self.k)) * 8 - return params + params = {param: self.get(param) for param in ["kty", "crv", "use", "key_ops"] if param in self} + if self.get("kty") == "RSA": + params["size"] = self._get_public_key().key_size + elif self.get("kty") == "oct": + params["size"] = len(base64url_decode(self.k)) * 8 + return params def _get_gen_size(self, params, default_size=None): size = default_size