simplexmq-6.5.0.16: SimpleXMQ message broker
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simplex.Messaging.Crypto.File

Synopsis

Documentation

data CryptoFile Source #

Constructors

CryptoFile 

Fields

Instances

Instances details
FromJSON CryptoFile Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

parseJSON :: Value -> Parser CryptoFile

parseJSONList :: Value -> Parser [CryptoFile]

omittedField :: Maybe CryptoFile

ToJSON CryptoFile Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

toJSON :: CryptoFile -> Value

toEncoding :: CryptoFile -> Encoding

toJSONList :: [CryptoFile] -> Value

toEncodingList :: [CryptoFile] -> Encoding

omitField :: CryptoFile -> Bool

Show CryptoFile Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

showsPrec :: Int -> CryptoFile -> ShowS

show :: CryptoFile -> String

showList :: [CryptoFile] -> ShowS

Eq CryptoFile Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

(==) :: CryptoFile -> CryptoFile -> Bool

(/=) :: CryptoFile -> CryptoFile -> Bool

data CryptoFileArgs Source #

Constructors

CFArgs 

Instances

Instances details
FromJSON CryptoFileArgs Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

parseJSON :: Value -> Parser CryptoFileArgs

parseJSONList :: Value -> Parser [CryptoFileArgs]

omittedField :: Maybe CryptoFileArgs

ToJSON CryptoFileArgs Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

toJSON :: CryptoFileArgs -> Value

toEncoding :: CryptoFileArgs -> Encoding

toJSONList :: [CryptoFileArgs] -> Value

toEncodingList :: [CryptoFileArgs] -> Encoding

omitField :: CryptoFileArgs -> Bool

Show CryptoFileArgs Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

showsPrec :: Int -> CryptoFileArgs -> ShowS

show :: CryptoFileArgs -> String

showList :: [CryptoFileArgs] -> ShowS

Eq CryptoFileArgs Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

data CryptoFileHandle Source #

Constructors

CFHandle Handle (Maybe (TVar SbState)) 

data FTCryptoError Source #

Instances

Instances details
Exception FTCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

toException :: FTCryptoError -> SomeException

fromException :: SomeException -> Maybe FTCryptoError

displayException :: FTCryptoError -> String

Show FTCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

Methods

showsPrec :: Int -> FTCryptoError -> ShowS

show :: FTCryptoError -> String

showList :: [FTCryptoError] -> ShowS

Eq FTCryptoError Source # 
Instance details

Defined in Simplex.Messaging.Crypto.File

withFile :: CryptoFile -> IOMode -> (CryptoFileHandle -> ExceptT FTCryptoError IO a) -> ExceptT FTCryptoError IO a Source #

hGet :: CryptoFileHandle -> Int -> IO ByteString Source #

hGetTag :: CryptoFileHandle -> ExceptT FTCryptoError IO () Source #

Read and validate the auth tag. This function should be called after reading the whole file, it assumes you know the file size and read only the needed bytes.

plain :: FilePath -> CryptoFile Source #

randomArgs :: TVar ChaChaDRG -> STM CryptoFileArgs Source #