Function iota_keys::keypair_file::read_key
source ยท pub fn read_key(
path: &PathBuf,
require_secp256k1: bool,
) -> Result<IotaKeyPair, Error>
Expand description
Read an IotaKeyPair from a file. The content could be any of the following:
- Base64 encoded
flag || privkey
for ECDSA key - Base64 encoded
privkey
for Raw key - Bech32 encoded private key prefixed with
iotaprivkey
- Hex encoded
privkey
for Raw key
If require_secp256k1
is true, it will return an error if the key is not
Secp256k1.