Package com.goterl.lazysodium.interfaces
Interface KeyExchange.Lazy
- All Known Implementing Classes:
LazySodium,LazySodiumJava
- Enclosing interface:
- KeyExchange
public static interface KeyExchange.Lazy
-
Method Summary
Modifier and TypeMethodDescriptioncryptoKxClientSessionKeys(KeyPair clientKeyPair, Key serverPublicKey) Generate a client's session keys.cryptoKxClientSessionKeys(KeyPair clientKeyPair, KeyPair serverKeyPair) Deprecated, for removal: This API element is subject to removal in a future version.Client should not have the whole server keypair including the secret key!cryptoKxClientSessionKeys(Key clientPk, Key clientSk, Key serverPk) Generate a client's session keys.Generate a public and secret key.cryptoKxKeypair(byte[] seed) Deterministically generate a public and secret key.cryptoKxServerSessionKeys(KeyPair serverKeyPair, Key clientPublicKey) Generate a server's session keys.cryptoKxServerSessionKeys(KeyPair serverKeyPair, KeyPair clientKeyPair) Deprecated, for removal: This API element is subject to removal in a future version.Client should not have the whole server keypair including the secret key!cryptoKxServerSessionKeys(Key serverPk, Key serverSk, Key clientPk) Computes a pair of shared keys (server-side) (rx and tx) using the client's public key clientPk, the server's secret key serverSk and the server's public key serverPk.
-
Method Details
-
cryptoKxKeypair
Generate a public and secret key.- Returns:
- A KeyPair containing a public and secret key.
- Throws:
SodiumException
-
cryptoKxKeypair
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 sizeKeyExchange.SEEDBYTES.- Returns:
- The generated key pair.
- Throws:
SodiumException
-
cryptoKxClientSessionKeys
SessionPair cryptoKxClientSessionKeys(Key clientPk, Key clientSk, Key serverPk) throws SodiumException Generate a client's session keys. This should be performed on the client.- Parameters:
clientPk- Client public key of sizeKeyExchange.PUBLICKEYBYTES.clientSk- Client secret key of sizeKeyExchange.SECRETKEYBYTES.serverPk- Server public key of sizeKeyExchange.PUBLICKEYBYTES.- Returns:
- A session pair of keys.
- Throws:
SodiumException- If the size of any of the keys are wrong.- See Also:
-
cryptoKxClientSessionKeys
@Deprecated(forRemoval=true, since="6.0.0") SessionPair cryptoKxClientSessionKeys(KeyPair clientKeyPair, KeyPair serverKeyPair) throws SodiumException Deprecated, for removal: This API element is subject to removal in a future version.Client should not have the whole server keypair including the secret key!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.
-
cryptoKxClientSessionKeys
SessionPair cryptoKxClientSessionKeys(KeyPair clientKeyPair, Key serverPublicKey) 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.serverPublicKey- Provide the server's public key.- Returns:
- Session keys.
- Throws:
SodiumException- Not provided the correct keys, or generation of session keys failed.
-
cryptoKxServerSessionKeys
SessionPair cryptoKxServerSessionKeys(Key serverPk, Key serverSk, Key clientPk) throws SodiumException Computes a pair of shared keys (server-side) (rx and tx) using the client's public key clientPk, the server's secret key serverSk and the server's public key serverPk.- Parameters:
serverPk- Server public key of sizeKeyExchange.PUBLICKEYBYTES.serverSk- Server secret key of sizeKeyExchange.SECRETKEYBYTES.clientPk- Client public key of sizeKeyExchange.PUBLICKEYBYTES.- Returns:
- True if successful or false if the client public key is wrong.
- Throws:
SodiumException
-
cryptoKxServerSessionKeys
@Deprecated(forRemoval=true, since="6.0.0") SessionPair cryptoKxServerSessionKeys(KeyPair serverKeyPair, KeyPair clientKeyPair) throws SodiumException Deprecated, for removal: This API element is subject to removal in a future version.Client should not have the whole server keypair including the secret key!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.
-
cryptoKxServerSessionKeys
SessionPair cryptoKxServerSessionKeys(KeyPair serverKeyPair, Key clientPublicKey) 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.clientPublicKey- Provide the client's public key.- Returns:
- Session keys.
- Throws:
SodiumException- Not provided the correct keys, or generation of session keys failed.
-