aea.crypto.helpers
Module wrapping the helpers of public and private key cryptography.
try_
validate_
private_
key_
path
try_validate_private_key_path(ledger_id: str, private_key_path: str, password: Optional[str] = None) -> None
Try validate a private key path.
Arguments:
ledger_id
: one of 'fetchai', 'ethereum'private_key_path
: the path to the private key.password
: the password to encrypt/decrypt the private key. :raises: ValueError if the identifier is invalid.
create_
private_
key
Create a private key for the specified ledger identifier.
Arguments:
ledger_id
: the ledger identifier.private_key_file
: the private key file.password
: the password to encrypt/decrypt the private key. :raises: ValueError if the identifier is invalid.
try_
generate_
testnet_
wealth
try_generate_testnet_wealth(identifier: str, address: str, url: Optional[str] = None, _sync: bool = True) -> None
Try generate wealth on a testnet.
Arguments:
identifier
: the identifier of the ledgeraddress
: the address to check forurl
: the url_sync
: whether to wait to sync or not; currently unused
private_
key_
verify
private_key_verify(aea_conf: AgentConfig, aea_project_path: Path, password: Optional[str] = None) -> None
Check key.
Arguments:
aea_conf
: AgentConfigaea_project_path
: Path, where project placed.password
: the password to encrypt/decrypt the private key.
make_
certificate
make_certificate(ledger_id: str, crypto_private_key_path: str, message: bytes, output_path: str, password: Optional[str] = None) -> str
Create certificate.
Arguments:
ledger_id
: the ledger idcrypto_private_key_path
: the path to the private key.message
: the message to be signed.output_path
: the location where to save the certificate.password
: the password to encrypt/decrypt the private keys.
Returns:
the signature/certificate
get_
wallet_
from_
agent_
config
Get wallet from agent_cofig provided.
Arguments:
agent_config
: the agent configuration objectpassword
: the password to encrypt/decrypt the private keys.
Returns:
wallet
DecryptError Objects
Error on bytes decryption with password.
__
init__
Init exception.
KeyIsIncorrect Objects
Error decoding hex string to bytes for private key.
hex_
to_
bytes_
for_
key
Convert hex string to bytes with error handling.