pub struct PrivateKey { /* fields omitted */ }
Privatekey, a keypair for performing ECDH and blinding operations.
from_bytes creates a new keypair from the given bytes
Load private and public PEM files.
generate creates a new key pair
rng
- an implementation of Rng, a random number generator.
- Returns a PrivateKey or an error.
load_bytes loads a key from the given bytes.
to_pem_files writes the public and privates keys to two PEM files.
regenerate uses the given rng to generate a new key.
public_key returns the PublicKey
Exp calculates the shared secret with the provided public key.
to_vec returns the private key as a Vec
as_array returns the private key as an array [u8; KEY_SIZE]
reset resets the key to explicit zeros
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Completely overwrites this value.
Called to initialize a place to a valid value, after it is set to all-bits-zero. Read more