Struct wireguard_control::backends::userspace::Key [−][src]
pub struct Key(_);
Expand description
Represents a WireGuard encryption key.
WireGuard makes no meaningful distinction between public, private and preshared keys - any sequence of 32 bytes can be used as either of those.
This means that you need to be careful when working with
Key
s, especially ones created from external data.
Implementations
Generates and returns a new private key.
Generates and returns a new preshared key.
Generates a public key for this private key.
Converts the key to a standardized base64 representation, as used by the wg
utility and wg-quick
.
Converts a base64 representation of the key to the raw bytes.
This can fail, as not all text input is valid base64 - in this case
Err(InvalidKey)
is returned.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Key
impl UnwindSafe for Key
Blanket Implementations
Mutably borrows from an owned value. Read more