Get the raw key for the given key_op. This method will also check if the given key_op is supported by this key. :param operation: key operation value, such as "sign", "encrypt". :return: raw key
(self, operation)
| 32 | return False |
| 33 | |
| 34 | def get_op_key(self, operation): |
| 35 | """Get the raw key for the given key_op. This method will also |
| 36 | check if the given key_op is supported by this key. |
| 37 | |
| 38 | :param operation: key operation value, such as "sign", "encrypt". |
| 39 | :return: raw key |
| 40 | """ |
| 41 | self.check_key_op(operation) |
| 42 | if not self.raw_key: |
| 43 | self.load_raw_key() |
| 44 | return self.raw_key |
| 45 | |
| 46 | def load_raw_key(self): |
| 47 | self.raw_key = urlsafe_b64decode(to_bytes(self.tokens["k"])) |