Interface KeyExchange.Lazy

    • Method Detail

      • cryptoKxKeypair

        KeyPair cryptoKxKeypair()
        Generate a public and secret key.
        Returns:
        A KeyPair containing a public and secret key.
      • cryptoKxKeypair

        KeyPair cryptoKxKeypair​(byte[] seed)
        Deterministically generate a public and secret key. Store the seed somewhere if you want to generate these keys again.
        Parameters:
        seed - A random seed of size KeyExchange.SEEDBYTES.
        Returns:
        The generated key pair.
      • cryptoKxClientSessionKeys

        SessionPair cryptoKxClientSessionKeys​(KeyPair clientKeyPair,
                                              KeyPair serverKeyPair)
                                       throws SodiumException
        Generate a client's session keys. This should be performed on the client.
        Parameters:
        clientKeyPair - Provide the client's public and private key.
        serverKeyPair - Provide the server's public key only.
        Returns:
        Session keys.
        Throws:
        SodiumException - Not provided the correct keys, or generation of session keys failed.
      • cryptoKxServerSessionKeys

        SessionPair cryptoKxServerSessionKeys​(KeyPair serverKeyPair,
                                              KeyPair clientKeyPair)
                                       throws SodiumException
        Generate a server's session keys. This should be performed on the server.
        Parameters:
        serverKeyPair - Provide the server's public and private key.
        clientKeyPair - Provide the client's public key only.
        Returns:
        Session keys.
        Throws:
        SodiumException - Not provided the correct keys, or generation of session keys failed.