@@ -19,12 +19,12 @@ class Signer(object):
1919
2020 Password-protected keyfiles are not supported.
2121 """
22- def __init__ (self , secret , algorithm = None , digital_signature_algorithm = None ):
22+ def __init__ (self , secret , algorithm = None , sign_algorithm = None ):
2323 if algorithm is None :
2424 algorithm = DEFAULT_SIGN_ALGORITHM
2525
2626 assert algorithm in ALGORITHMS , "Unknown algorithm"
27- assert digital_signature_algorithm in DIGITAL_SIGNATURE_ALGORITHMS , "Unsupported digital signature algrotihm"
27+ assert sign_algorithm in SIGN_ALGORITHMS , "Unsupported digital signature algrotihm"
2828
2929 if algorithm != DEFAULT_SIGN_ALGORITHM :
3030 print ("Algorithm: {} is deprecated please update to {}" .format (algorithm , DEFAULT_SIGN_ALGORITHM ))
@@ -39,8 +39,8 @@ def __init__(self, secret, algorithm=None, digital_signature_algorithm=None):
3939 if "-" in algorithm :
4040 self .sign_algorithm , self .hash_algorithm = algorithm .split ('-' )
4141 elif algorithm == "hs2019" :
42- assert digital_signature_algorithm is not None , "Required digital signature algorithm not specified"
43- self .sign_algorithm = digital_signature_algorithm
42+ assert sign_algorithm is not None , "Required digital signature algorithm not specified"
43+ self .sign_algorithm = sign_algorithm
4444 self .hash_algorithm = "sha512"
4545
4646 if self .sign_algorithm == 'rsa' :
@@ -106,8 +106,8 @@ class HeaderSigner(Signer):
106106 :arg sign_header: header used to include signature, defaulting to
107107 'authorization'.
108108 """
109- def __init__ (self , key_id , secret , algorithm = None , headers = None , sign_header = 'authorization' ):
110- super (HeaderSigner , self ).__init__ (secret = secret , algorithm = algorithm )
109+ def __init__ (self , key_id , secret , algorithm = None , sign_algorithm = None , headers = None , sign_header = 'authorization' ):
110+ super (HeaderSigner , self ).__init__ (secret = secret , algorithm = algorithm , sign_algorithm = sign_algorithm )
111111 self .headers = headers or ['date' ]
112112 self .signature_template = build_signature_template (
113113 key_id , algorithm , headers , sign_header )
0 commit comments