diff options
| author | Emīls <emils@mullvad.net> | 2020-10-23 12:30:58 +0100 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2020-10-23 16:45:09 +0100 |
| commit | 4e124d0f4d4f96582e17c5fa4aa357764082b802 (patch) | |
| tree | 43ae3be25a035dda57241f1ed568901b0ef636e6 | |
| parent | c843c69863f89d01923dce546148724daab8bb89 (diff) | |
| download | mullvadvpn-4e124d0f4d4f96582e17c5fa4aa357764082b802.tar.xz mullvadvpn-4e124d0f4d4f96582e17c5fa4aa357764082b802.zip | |
Allow converting WireGuard private key to base64
| -rw-r--r-- | talpid-types/src/net/wireguard.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/talpid-types/src/net/wireguard.rs b/talpid-types/src/net/wireguard.rs index 0433179880..62441a369c 100644 --- a/talpid-types/src/net/wireguard.rs +++ b/talpid-types/src/net/wireguard.rs @@ -93,6 +93,10 @@ impl PrivateKey { pub fn public_key(&self) -> PublicKey { PublicKey::from(&self.0) } + + pub fn to_base64(&self) -> String { + base64::encode(self.0.to_bytes()) + } } impl From<[u8; 32]> for PrivateKey { |
