File tree Expand file tree Collapse file tree 5 files changed +9
-0
lines changed
Expand file tree Collapse file tree 5 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def __init__(
6969 "RS384" ,
7070 "RS512" ,
7171 "ES256" ,
72+ "ES256K" ,
7273 "ES384" ,
7374 "ES512" ,
7475 "PS256" ,
@@ -86,6 +87,7 @@ def __init__(
8687 "RS384" ,
8788 "RS512" ,
8889 "ES256" ,
90+ "ES256K" ,
8991 "ES384" ,
9092 "ES512" ,
9193 "PS256" ,
Original file line number Diff line number Diff line change 2828 "P-256" : ec .SECP256R1 ,
2929 "P-224" : ec .SECP224R1 ,
3030 "P-192" : ec .SECP192R1 ,
31+ "P-256K" : ec .SECP256K1 ,
3132}
3233
3334# Inverted NIST2SEC dictionary
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ def __init__(self, algorithm="ES256"):
1616 if algorithm == "ES256" :
1717 self .hash_algorithm = hashes .SHA256
1818 self .curve_name = "secp256r1"
19+ elif algorithm == "ES256K" :
20+ self .hash_algorithm = hashes .SHA256
21+ self .curve_name = "secp256k1"
1922 elif algorithm == "ES384" :
2023 self .hash_algorithm = hashes .SHA384
2124 self .curve_name = "secp384r1"
Original file line number Diff line number Diff line change 4141 "RS384" : RSASigner ("RS384" ),
4242 "RS512" : RSASigner ("RS512" ),
4343 "ES256" : ECDSASigner ("ES256" ),
44+ "ES256K" : ECDSASigner ("ES256K" ),
4445 "ES384" : ECDSASigner ("ES384" ),
4546 "ES512" : ECDSASigner ("ES512" ),
4647 "PS256" : PSSSigner ("SHA256" ),
Original file line number Diff line number Diff line change @@ -1364,6 +1364,8 @@ def key_by_alg(alg: str):
13641364 elif alg .startswith ("ES" ):
13651365 if alg == "ES256" :
13661366 return key_gen ("EC" , crv = "P-256" )
1367+ elif alg == "ES256K" :
1368+ return key_gen ("EC" , crv = "P-256K" )
13671369 elif alg == "ES384" :
13681370 return key_gen ("EC" , crv = "P-384" )
13691371 elif alg == "ES512" :
You can’t perform that action at this time.
0 commit comments