ecdh_fun() = fun((pubkey()) -> binary())
enacl_privkey() = <<_:256>>
enacl_pubkey() = <<_:256>>
key_map() = #{secret => privkey(), public => pubkey(), network => network()}
key_type() = ecc_compact | ed25519
network() = mainnet | testnet
privkey() = {ecc_compact, ecc_compact:private_key()} | {ed25519, enacl_privkey()}
pubkey() = {ecc_compact, ecc_compact:public_key()} | {ed25519, enacl_pubkey()}
pubkey_bin() = <<_:8, _:_*8>>
sig_fun() = fun((binary()) -> binary())
b58_to_bin/1 | Convert a base58 check encoded string to the original binary.The version encoded in the base58 encoded string is ignore. |
b58_to_pubkey/1 | Converts a base58 check encoded string to a public key. |
b58_to_pubkey/2 | Converts a base58 check encoded string to a public key. |
b58_to_version_bin/1 | Decodes a base58 check ecnoded string into it's version and binary parts. |
bin_to_b58/1 | Convert a binary to a base58 check encoded string. |
bin_to_b58/2 | Convert a binary to a base58 check encoded string. |
bin_to_pubkey/1 | Convertsa a given binary encoded public key to a tagged public key. |
bin_to_pubkey/2 | Convertsa a given binary encoded public key to a tagged public key. |
generate_keys/1 | Generate keys suitable for a swarm. |
generate_keys/2 | Generate keys suitable for a swarm on a given network. |
keys_from_bin/1 | Convers a given binary to a key map. |
keys_to_bin/1 | Convert a given key map to a binary representation that can be saved to file. |
load_keys/1 | Load the private key from a pem encoded given filename. |
mk_ecdh_fun/1 | Constructs an ECDH exchange function from a given private key. |
mk_sig_fun/1 | Construct a signing function from a given private key. |
p2p_to_pubkey_bin/1 | Takes a P2P address and decodes it to a binary public key. |
pubkey_bin_to_p2p/1 | Converts a given binary public key to a P2P address. |
pubkey_to_b58/1 | Converts a public key to base58 check encoded string. |
pubkey_to_b58/2 | Converts a public key to base58 check encoded string on the given network. |
pubkey_to_bin/1 | Convertsa a given tagged public key to its binary form on mainnet. |
pubkey_to_bin/2 | Convertsa a given tagged public key to its binary form on the given network. |
save_keys/2 | Store the given keys in a given filename. |
verify/3 | Verifies a binary against a given digital signature over the sha256 of the binary. |
b58_to_bin(Str::string()) -> binary()
Convert a base58 check encoded string to the original binary.The version encoded in the base58 encoded string is ignore.
See also: b58_to_version_bin/1.
b58_to_pubkey(Str::string()) -> pubkey()
Converts a base58 check encoded string to a public key. The public key is asserted to be on mainnet.
Converts a base58 check encoded string to a public key. The public key is asserted to be on the given network.
b58_to_version_bin(Str::string()) -> {Version::non_neg_integer(), Bin::binary()}
Decodes a base58 check ecnoded string into it's version and binary parts.
bin_to_b58(Bin::binary()) -> string()
Convert a binary to a base58 check encoded string. The encoded version is set to 0.
See also: bin_to_b58/2.
bin_to_b58(Version::non_neg_integer(), Bin::binary()) -> string()
Convert a binary to a base58 check encoded string
bin_to_pubkey(PubKeyBin::pubkey_bin()) -> pubkey()
Convertsa a given binary encoded public key to a tagged public key. The key is asserted to be on mainnet
bin_to_pubkey(Network::network(), X2::pubkey_bin()) -> pubkey()
Convertsa a given binary encoded public key to a tagged public key. If the given binary is not on the specified network a bad_network is thrown.
generate_keys(KeyType::key_type()) -> key_map()
Generate keys suitable for a swarm. The returned private and public key has the attribute that the public key is a compressable public key.
generate_keys(Network::network(), X2::key_type()) -> key_map()
Generate keys suitable for a swarm on a given network. The returned private and public key has the attribute that the public key is a compressable public key if ecc_compact is used.
keys_from_bin(X1::binary()) -> key_map()
Convers a given binary to a key map
keys_to_bin(Keys::key_map()) -> binary()
Convert a given key map to a binary representation that can be saved to file.
load_keys(FileName::string()) -> {ok, key_map()} | {error, term()}
Load the private key from a pem encoded given filename. Returns the private and extracted public key stored in the file or an error if any occorred.
mk_ecdh_fun(X1::privkey()) -> ecdh_fun()
Constructs an ECDH exchange function from a given private key.
Note that a Key Derivation Function should be applied to these keys before useConstruct a signing function from a given private key. Using a signature function instead of passing a private key around allows different signing implementations, such as one built on a hardware based security module.
p2p_to_pubkey_bin(Str::string()) -> pubkey_bin()
Takes a P2P address and decodes it to a binary public key
pubkey_bin_to_p2p(PubKey::pubkey_bin()) -> string()
Converts a given binary public key to a P2P address.
See also: p2p_to_pubkey_bin/1.
pubkey_to_b58(PubKey::pubkey()) -> string()
Converts a public key to base58 check encoded string.
Converts a public key to base58 check encoded string on the given network.
pubkey_to_bin(PubKey::pubkey()) -> pubkey_bin()
Convertsa a given tagged public key to its binary form on mainnet.
pubkey_to_bin(Network::network(), X2::pubkey()) -> pubkey_bin()
Convertsa a given tagged public key to its binary form on the given network.
save_keys(KeysMap::key_map(), FileName::string()) -> ok | {error, term()}
Store the given keys in a given filename. The keypair is converted to binary keys_to_bin
See also: keys_to_bin/1.
verify(Bin::binary(), Signature::binary(), X3::pubkey()) -> boolean()
Verifies a binary against a given digital signature over the sha256 of the binary.
Generated by EDoc