module Network.TLS.Types
( Version(..)
, SessionID
, SessionData(..)
, CipherID
, CompressionID
, Role(..)
, invertRole
, Direction(..)
) where
import Data.ByteString (ByteString)
import Data.Word
data Version = SSL2 | SSL3 | TLS10 | TLS11 | TLS12 deriving (Show, Eq, Ord)
type SessionID = ByteString
data SessionData = SessionData
{ sessionVersion :: Version
, sessionCipher :: CipherID
, sessionSecret :: ByteString
} deriving (Show,Eq)
type CipherID = Word16
type CompressionID = Word8
data Role = ClientRole | ServerRole
deriving (Show,Eq)
data Direction = Tx | Rx
deriving (Show,Eq)
invertRole :: Role -> Role
invertRole ClientRole = ServerRole
invertRole ServerRole = ClientRole