fixed private key extraction