Uses of Class
org.drasyl.crypto.sodium.SessionPair
Package
Description
Classes for crypto-related operations.
Libsodium wrappers for the crypto operations of drasyl
The protocol used for communication with remote peers.
Contains classes necessary for encrypted peer/application communication.
-
Uses of SessionPair in org.drasyl.crypto
Modifier and TypeMethodDescription<P extends PublicKey,
S extends SecretKey>
SessionPairCrypto.generateSessionKeyPair
(KeyPair<P, S> myKeyPair, PublicKey receiverPublicKey) Generates session key pair from themyKeyPair
andreceiverKeyPair
.Modifier and TypeMethodDescriptionbyte[]
Crypto.decrypt
(byte[] cipher, byte[] authTag, Nonce nonce, SessionPair sessionPair) Decrypt the givencipher
, by verify theauthTag
as an authentication tag, uses the givennonce
and decrypting with the rx part of thesessionPair
.byte[]
Crypto.encrypt
(byte[] message, byte[] authTag, Nonce nonce, SessionPair sessionPair) Encrypts the givenmessage
, by addingauthTag
as an authentication tag, using the given (hopefully fresh)nonce
and encrypting with the tx part of thesessionPair
. -
Uses of SessionPair in org.drasyl.crypto.sodium
Modifier and TypeMethodDescriptionDrasylSodiumWrapper.cryptoKxClientSessionKeys
(byte[] clientPk, byte[] clientSk, byte[] serverPk) This function computes a pair of shared keys (rx and tx) using the client's public key clientPk, the client's secret key clientSk and the server's public key serverPk.DrasylSodiumWrapper.cryptoKxServerSessionKeys
(byte[] serverPk, byte[] serverSk, byte[] clientPk) This function computes a pair of shared keys (rx and tx) using the client's public key clientPk, the server's secret key serverSk and the server's public key serverPk.static SessionPair
SessionPair.of
(byte[] rx, byte[] tx) -
Uses of SessionPair in org.drasyl.handler.remote.protocol
Modifier and TypeMethodDescriptionFullReadMessage.arm
(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) Returns an armed version (ArmedProtocolMessage
) of this message for sending it through untrustworthy channels.UnarmedProtocolMessage.arm
(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) Returns an armed version (ArmedProtocolMessage
) of this message.UnarmedProtocolMessage.armAndRelease
(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) Returns an armed version (ArmedProtocolMessage
) of this message and then releases this message.ArmedProtocolMessage.disarm
(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) Returns a disarmed version (FullReadMessage
) of this message.ArmedProtocolMessage.disarmAndRelease
(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) Returns a disarmed version (FullReadMessage
) of this message and then releases this message. -
Uses of SessionPair in org.drasyl.node.handler.crypto
Modifier and TypeMethodDescriptionstatic Agreement
Agreement.of
(AgreementId id, SessionPair sessionPair, long staleAt)