Documentation ¶
Index ¶
- type EncryptionModule
- func (em *EncryptionModule) CompleteKeyExchange(key []byte) error
- func (em *EncryptionModule) Decrypt(emsg *drshproto.EncryptedSessionMessage) ([]byte, error)
- func (em *EncryptionModule) Encrypt(data []byte) (*drshproto.EncryptedSessionMessage, error)
- func (em *EncryptionModule) FreePrivateKeys()
- func (em *EncryptionModule) PrepareKeyExchange() error
- func (em *EncryptionModule) WaitForKeyExchange()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptionModule ¶
Attached to a host and provides the host with key exchange & symmetric encryption capabilities
func NewEncryptionModule ¶
func NewEncryptionModule() *EncryptionModule
func (*EncryptionModule) CompleteKeyExchange ¶
func (em *EncryptionModule) CompleteKeyExchange(key []byte) error
Marks the completion of the key exchange protocol. When the key exchange handshake is performed, the other host's public key is mixed with the keypair generated via PrepareKeyExchange. This creates a shared secret, passed through a KDF and given to a cipher.
func (*EncryptionModule) Decrypt ¶
func (em *EncryptionModule) Decrypt(emsg *drshproto.EncryptedSessionMessage) ([]byte, error)
Decrypts a ciphertext with the key formed during the key exchange process. If encryption is not enabled, then the data is returned without modification.
func (*EncryptionModule) Encrypt ¶
func (em *EncryptionModule) Encrypt(data []byte) (*drshproto.EncryptedSessionMessage, error)
Encrypt a message with the key formed during the key exchange process. If encryption is not enabled, then the data is returned without modification.
func (*EncryptionModule) FreePrivateKeys ¶
func (em *EncryptionModule) FreePrivateKeys()
Removes references to the keypair, allowing for it to be garbage collected.
func (*EncryptionModule) PrepareKeyExchange ¶
func (em *EncryptionModule) PrepareKeyExchange() error
Creates the host's keypair needed for key exchange.
func (*EncryptionModule) WaitForKeyExchange ¶
func (em *EncryptionModule) WaitForKeyExchange()
Blocks until a key exchange has been completed, resulting in a valid cipher