File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 88from cryptojwt .jwk .ec import NIST2SEC
99from cryptojwt .jwk .ec import new_ec_key
1010from cryptojwt .jwk .hmac import new_sym_key
11+ from cryptojwt .jwk .okp import OKP_CRV2PUBLIC
12+ from cryptojwt .jwk .okp import new_okp_key
1113from cryptojwt .jwk .rsa import new_rsa_key
1214from cryptojwt .utils import b64e
1315
@@ -28,7 +30,7 @@ def main():
2830 dest = "crv" ,
2931 metavar = "curve" ,
3032 help = "EC curve" ,
31- choices = NIST2SEC .keys (),
33+ choices = list ( NIST2SEC .keys ()) + list ( OKP_CRV2PUBLIC . keys () ),
3234 default = DEFAULT_EC_CURVE ,
3335 )
3436 parser .add_argument (
@@ -51,6 +53,11 @@ def main():
5153 print ("Unknown curve: {0}" .format (args .crv ), file = sys .stderr )
5254 exit (1 )
5355 jwk = new_ec_key (crv = args .crv , kid = args .kid )
56+ elif args .kty .upper () == "OKP" :
57+ if args .crv not in OKP_CRV2PUBLIC :
58+ print ("Unknown curve: {0}" .format (args .crv ), file = sys .stderr )
59+ exit (1 )
60+ jwk = new_okp_key (crv = args .crv , kid = args .kid )
5461 elif args .kty .upper () == "SYM" or args .kty .upper () == "OCT" :
5562 if args .keysize is None :
5663 args .keysize = DEFAULT_SYM_KEYSIZE
You can’t perform that action at this time.
0 commit comments