Check the public key and the private key. The private key is optional (replace by None)
(self, privkey, pubkey)
| 244 | OpenSSL.BN_free(own_priv_key) |
| 245 | |
| 246 | def check_key(self, privkey, pubkey): |
| 247 | """ |
| 248 | Check the public key and the private key. |
| 249 | The private key is optional (replace by None) |
| 250 | """ |
| 251 | curve, pubkey_x, pubkey_y, i = ECC._decode_pubkey(pubkey) |
| 252 | if privkey is None: |
| 253 | raw_privkey = None |
| 254 | curve2 = curve |
| 255 | else: |
| 256 | curve2, raw_privkey, i = ECC._decode_privkey(privkey) |
| 257 | if curve != curve2: |
| 258 | raise Exception("Bad public and private key") |
| 259 | return self.raw_check_key(raw_privkey, pubkey_x, pubkey_y, curve) |
| 260 | |
| 261 | def raw_check_key(self, privkey, pubkey_x, pubkey_y, curve=None): |
| 262 | if curve is None: |
nothing calls this directly
no test coverage detected