MCPcopy
hub / github.com/authlib/authlib / unwrap

Method unwrap

authlib/jose/rfc7518/jwe_algs.py:78–83  ·  view source on GitHub ↗
(self, enc_alg, ek, headers, key)

Source from the content-addressed store, hash-verified

76 return {"ek": ek, "cek": cek}
77
78 def unwrap(self, enc_alg, ek, headers, key):
79 op_key = key.get_op_key("unwrapKey")
80 cek = op_key.decrypt(ek, self.padding)
81 if len(cek) * 8 != enc_alg.CEK_SIZE:
82 cek = secrets.token_bytes(enc_alg.CEK_SIZE // 8)
83 return cek
84
85
86class AESAlgorithm(JWEAlgorithm):

Callers 1

unwrapMethod · 0.45

Calls 2

get_op_keyMethod · 0.45
decryptMethod · 0.45

Tested by

no test coverage detected