commsec-0.2.3: Provide communications security using symmetric ephemeral keys

Safe HaskellNone

Network.CommSec

Contents

Synopsis

Types

data Connection Source

A connection is a secure bidirectional communication channel.

Constructors

Conn 

data CommSecError Source

Errors that can be returned by the decoding/receicing operations.

Send and receive operations

sendPtr :: Connection -> Ptr Word8 -> Int -> IO ()Source

Sends a message over the connection.

recvPtr :: Connection -> Ptr Word8 -> Int -> IO IntSource

Blocks till it receives a valid message, placing the resulting plaintext in the provided buffer. If the incoming message is larger that the provided buffer then the message is truncated. This process also incurs an additional copy.

Establishing a connection from a shared secret

accept :: ByteString -> PortNumber -> IO ConnectionSource

Expands the provided 128 (or more) bit secret into two keys to create a connection.

ex: accept ent 3134

connect :: ByteString -> HostName -> PortNumber -> IO ConnectionSource

Expands the provided 128 (or more) bit secret into two keys to create a connection.

Establishing a connection from a public identity (PKI)

Utility