Method SSL.Cipher.generate_key_share()
- Method
generate_key_share
array(Gmp.mpz|string(8bit)) generate_key_share(objectcontext,intgroup)- Description
RFC 8446 4.2.8: Generate an ephemeral key share for the given named Constants.NamedGroup.
Unlike the TLS 1.2 and earlier KeyExchangeECDHE (which drives key agreement through a ServerKeyExchange/ClientKeyExchange message pair), TLS 1.3 key shares travel in ClientHello/ServerHello extensions, so this is a plain function pair rather than a KeyExchange subclass.
- Returns
Array Gmp.mpz|string(8bit)0The ephemeral secret (scalar), to keep and pass to compute_key_share_secret() once the peer's share arrives.
string(8bit)1The encoded public key, suitable for the
key_exchangefield of aKeyShareEntry.