Skip to content

Commit 411cb0f

Browse files
committed
rename
1 parent b0b0d66 commit 411cb0f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cryptojwt/jwk/okp.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
ed25519.Ed25519PrivateKey, ed448.Ed448PrivateKey, x25519.X25519PrivateKey, x448.X448PrivateKey
2626
]
2727

28-
CRV2PUBLIC = {
28+
OKP_CRV2PUBLIC = {
2929
"Ed25519": ed25519.Ed25519PublicKey,
3030
"Ed448": ed448.Ed448PublicKey,
3131
"X25519": x25519.X25519PublicKey,
3232
"X448": x448.X448PublicKey,
3333
}
3434

35-
CRV2PRIVATE = {
35+
OKP_CRV2PRIVATE = {
3636
"Ed25519": ed25519.Ed25519PrivateKey,
3737
"Ed448": ed448.Ed448PrivateKey,
3838
"X25519": x25519.X25519PrivateKey,
@@ -144,15 +144,15 @@ def deserialize(self):
144144
try:
145145
if isinstance(self.d, (str, bytes)):
146146
try:
147-
self.priv_key = CRV2PRIVATE[self.crv].from_private_bytes(deser(self.d))
147+
self.priv_key = OKP_CRV2PRIVATE[self.crv].from_private_bytes(deser(self.d))
148148
except KeyError:
149149
raise UnsupportedOKPCurve("Unsupported OKP curve: {}".format(self.crv))
150150
self.pub_key = self.priv_key.public_key()
151151
except ValueError as err:
152152
raise DeSerializationNotPossible(str(err))
153153
else:
154154
try:
155-
self.pub_key = CRV2PUBLIC[self.crv].from_public_bytes(_x)
155+
self.pub_key = OKP_CRV2PUBLIC[self.crv].from_public_bytes(_x)
156156
except KeyError:
157157
raise UnsupportedOKPCurve("Unsupported OKP curve: {}".format(self.crv))
158158

@@ -272,8 +272,8 @@ def __eq__(self, other):
272272
if self.__class__ != other.__class__:
273273
return False
274274

275-
_public_cls = CRV2PUBLIC[self.crv]
276-
_private_cls = CRV2PRIVATE[self.crv]
275+
_public_cls = OKP_CRV2PUBLIC[self.crv]
276+
_private_cls = OKP_CRV2PRIVATE[self.crv]
277277
if cmp_keys(self.pub_key, other.pub_key, _public_cls):
278278
if other.private_key():
279279
if cmp_keys(self.priv_key, other.priv_key, _private_cls):
@@ -322,7 +322,7 @@ def cmp_keys(a, b, key_type):
322322

323323
def new_okp_key(crv, kid="", **kwargs):
324324

325-
_key = CRV2PRIVATE[crv].generate()
325+
_key = OKP_CRV2PRIVATE[crv].generate()
326326

327327
_rk = OKPKey(priv_key=_key, kid=kid, **kwargs)
328328
if not kid:

0 commit comments

Comments
 (0)