Generate a new X25519 keypair for use with sealed box operations Returns a tuple of (PublicKey, StaticSecret)
()
| 31 | /// |
| 32 | /// Returns a tuple of (PublicKey, StaticSecret) |
| 33 | pub fn generate_keypair() -> (PublicKey, StaticSecret) { |
| 34 | let secret = StaticSecret::random_from_rng(OsRng); |
| 35 | let public = PublicKey::from(&secret); |
| 36 | (public, secret) |
| 37 | } |
| 38 | |
| 39 | /// Derives a nonce from the ephemeral public key and recipient's public key. |
| 40 | /// |
no outgoing calls