pub struct ServerKeyPair { /* private fields */ }Expand description
Full server key material: McEliece + Ed25519 + symmetric obfuscation key (fast mode).
Generated once at server setup, saved to a file, and loaded on each server start.
Use to_client_certificate to produce distributable client
certificates, and pass to ListenerBuilder::new to
start the server.
Implementations§
Source§impl ServerKeyPair
impl ServerKeyPair
Sourcepub fn to_client_certificate(
&self,
addresses: Vec<SocketAddr>,
) -> ClientCertificate
pub fn to_client_certificate( &self, addresses: Vec<SocketAddr>, ) -> ClientCertificate
Derive a client certificate from this key pair, embedding the given server addresses.
Sourcepub fn save(&self, path: impl AsRef<Path>) -> Result<(), CertificateError>
pub fn save(&self, path: impl AsRef<Path>) -> Result<(), CertificateError>
Save the server key pair to a binary file (fast mode).
§File layout (fast mode, F)
| Offset | Size | Field | Description |
|---|---|---|---|
| 0 | 10 | Header | Magic TYPHOON, type S, mode F, version 1 |
| 10 | 261120 (EPK_BYTES) | EPK | Classic McEliece 348864 public key |
| 261130 | 6492 (ESK_BYTES) | ESK | Classic McEliece 348864 secret key |
| 267622 | 32 (ED25519_BYTES) | VSK | Ed25519 signing key (seed) |
| 267654 | 32 (ED25519_BYTES) | OBFS | Symmetric tailer obfuscation key |
| 267686 | — | EOF |
Trait Implementations§
Auto Trait Implementations§
impl !UnwindSafe for ServerKeyPair
impl Freeze for ServerKeyPair
impl RefUnwindSafe for ServerKeyPair
impl Send for ServerKeyPair
impl Sync for ServerKeyPair
impl Unpin for ServerKeyPair
impl UnsafeUnpin for ServerKeyPair
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more