Expand description
Cryptographic utilities.
Re-exports§
pub use crate::crypto_bytes::CryptoBytes;pub use crate::crypto_bytes::PublicBytes;pub use crate::crypto_bytes::SignatureBytes;
Modules§
- key_
types - Known key types; this also functions as a global registry of key types for projects wishing to avoid collisions with each other.
Structs§
- Account
Id32 - An opaque 32-byte cryptographic identifier.
- Address
Uri - A container for results of parsing the address uri string.
- Crypto
Type Id - An identifier for a specific cryptographic algorithm used by a key pair
- KeyType
Id - An identifier for a type of cryptographic key.
- Secret
Uri - A secret uri (
SURI) that can be used to generate a key pair. - Ss58
Address Format - A custom address format. See also
Ss58AddressFormatRegistry
Enums§
- Address
UriError - Errors that are possible during parsing the address URI.
- Derive
Error - An error when deriving a key.
- Derive
Junction - A since derivation junction description. It is the single parameter used when creating
a new secret key from an existing secret key and, in the case of
SoftRawandSoftIndexa new public key from an existing public key. - Public
Error - An error type for SS58 decoding.
- Secret
String Error - An error with the interpretation of a secret.
- Ss58
Address Format Registry - A known address (sub)format/network ID for SS58.
Constants§
- DEV_
ADDRESS - The address of the associated root phrase for our publicly known keys.
- DEV_
PHRASE - The root phrase for our publicly known keys.
- JUNCTION_
ID_ LEN - The length of the junction identifier. Note that this is also referred to as the
CHAIN_CODE_LENGTHin the context of Schnorrkel.
Traits§
- Byte
Array - Trait used for types that are really just a fixed-length array.
- Crypto
Type - Type which has a particular kind of crypto associated with it.
- Derive
- Derivable key trait.
- Expose
Secret - Expose a reference to an inner secret
- From
Entropy - Create random values of
Selfgiven a stream of entropy. - IsWrapped
By - One type is wrapped by another.
- Pair
- Trait suitable for typical cryptographic PKI key pair type.
- Public
- Trait suitable for cryptographic public keys.
- Signature
- Trait suitable for cryptographic signatures.
- Ss58
Codec - Key that can be encoded to/from SS58.
- Unchecked
From - Similar to
From, except that the onus is on the part of the caller to ensure that data passed in makes sense. Basically, you’re not guaranteed to get anything sensible out. - Unchecked
Into - The counterpart to
UncheckedFrom. - VrfCrypto
- Trait grouping types shared by a VRF signer and verifiers.
- VrfPublic
- VRF Public Key.
- VrfSecret
- VRF Secret Key.
- Wraps
- Opposite of
IsWrappedBy- denotes a type which is a simple wrapper around another type. - Zeroize
- Trait to zeroize a memory buffer. Trait for securely erasing values from memory.
Functions§
- default_
ss58_ version - Returns default SS58 format used by the current active process.
- from_
known_ address_ format - const function to convert
Ss58AddressFormatto u16 - get_
public_ from_ string_ or_ panic - Interprets the string
sin order to generate a public key without password. - set_
default_ ss58_ version - Set the default SS58 “version”.
- unwrap_
or_ default_ ss58_ version - Returns either the input address format or the default.
Type Aliases§
- Dummy
- Dummy cryptography. Doesn’t do anything.
- Secret
String - Secret strings
Derive Macros§
- Zeroize
- Trait to zeroize a memory buffer.
Derive the
Zeroizetrait.