MCPcopy Create free account
hub / github.com/authlib/authlib / prepare_key

Method prepare_key

authlib/jose/rfc7518/jws_algs.py:123–129  ·  view source on GitHub ↗
(self, raw_data)

Source from the content-addressed store, hash-verified

121 self.hash_alg = getattr(self, f"SHA{sha_type}")
122
123 def prepare_key(self, raw_data):
124 key = ECKey.import_key(raw_data)
125 if key["crv"] != self.curve:
126 raise ValueError(
127 f'Key for "{self.name}" not supported, only "{self.curve}" allowed'
128 )
129 return key
130
131 def sign(self, msg, key):
132 op_key = key.get_op_key("sign")

Callers

nothing calls this directly

Calls 1

import_keyMethod · 0.45

Tested by

no test coverage detected