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 8
8
from cryptojwt .jwk .ec import NIST2SEC
9
9
from cryptojwt .jwk .ec import new_ec_key
10
10
from cryptojwt .jwk .hmac import new_sym_key
11
+ from cryptojwt .jwk .okp import OKP_CRV2PUBLIC
12
+ from cryptojwt .jwk .okp import new_okp_key
11
13
from cryptojwt .jwk .rsa import new_rsa_key
12
14
from cryptojwt .utils import b64e
13
15
@@ -28,7 +30,7 @@ def main():
28
30
dest = "crv" ,
29
31
metavar = "curve" ,
30
32
help = "EC curve" ,
31
- choices = NIST2SEC .keys (),
33
+ choices = list ( NIST2SEC .keys ()) + list ( OKP_CRV2PUBLIC . keys () ),
32
34
default = DEFAULT_EC_CURVE ,
33
35
)
34
36
parser .add_argument (
@@ -51,6 +53,11 @@ def main():
51
53
print ("Unknown curve: {0}" .format (args .crv ), file = sys .stderr )
52
54
exit (1 )
53
55
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 )
54
61
elif args .kty .upper () == "SYM" or args .kty .upper () == "OCT" :
55
62
if args .keysize is None :
56
63
args .keysize = DEFAULT_SYM_KEYSIZE
You can’t perform that action at this time.
0 commit comments