HsOpenSSL-0.5: (Part of) OpenSSL binding for HaskellSource codeContentsIndex
OpenSSL.EVP.Cipher
Description
An interface to symmetric cipher algorithms.
Synopsis
data Cipher
data EVP_CIPHER
withCipherPtr :: Cipher -> (Ptr EVP_CIPHER -> IO a) -> IO a
getCipherByName :: String -> IO (Maybe Cipher)
getCipherNames :: IO [String]
cipherIvLength :: Cipher -> Int
data CipherCtx
data EVP_CIPHER_CTX
newCtx :: IO CipherCtx
withCipherCtxPtr :: CipherCtx -> (Ptr EVP_CIPHER_CTX -> IO a) -> IO a
data CryptoMode
= Encrypt
| Decrypt
cipherStrictly :: CipherCtx -> ByteString -> IO ByteString
cipherLazily :: CipherCtx -> ByteString -> IO ByteString
cipher :: Cipher -> String -> String -> CryptoMode -> String -> IO String
cipherBS :: Cipher -> String -> String -> CryptoMode -> ByteString -> IO ByteString
cipherLBS :: Cipher -> String -> String -> CryptoMode -> ByteString -> IO ByteString
Documentation
data Cipher Source
Cipher is an opaque object that represents an algorithm of symmetric cipher.
data EVP_CIPHER Source
withCipherPtr :: Cipher -> (Ptr EVP_CIPHER -> IO a) -> IO aSource
getCipherByName :: String -> IO (Maybe Cipher)Source
getCipherByName name returns a symmetric cipher algorithm whose name is name. If no algorithms are found, the result is Nothing.
getCipherNames :: IO [String]Source
getCipherNames returns a list of name of symmetric cipher algorithms.
cipherIvLength :: Cipher -> IntSource
data CipherCtx Source
data EVP_CIPHER_CTX Source
newCtx :: IO CipherCtxSource
withCipherCtxPtr :: CipherCtx -> (Ptr EVP_CIPHER_CTX -> IO a) -> IO aSource
data CryptoMode Source
CryptoMode represents instruction to cipher and such like.
Constructors
Encrypt
Decrypt
cipherStrictly :: CipherCtx -> ByteString -> IO ByteStringSource
cipherLazily :: CipherCtx -> ByteString -> IO ByteStringSource
cipherSource
:: Cipheralgorithm to use
-> Stringsymmetric key
-> StringIV
-> CryptoModeoperation
-> StringAn input string to encrypt/decrypt. Note that the string must not contain any letters which aren't in the range of U+0000 - U+00FF.
-> IO Stringthe result string
cipher lazilly encrypts or decrypts a stream of data. The input string doesn't necessarily have to be finite.
cipherBSSource
:: Cipheralgorithm to use
-> Stringsymmetric key
-> StringIV
-> CryptoModeoperation
-> ByteStringinput string to encrypt/decrypt
-> IO ByteStringthe result string
cipherBS strictly encrypts or decrypts a chunk of data.
cipherLBSSource
:: Cipheralgorithm to use
-> Stringsymmetric key
-> StringIV
-> CryptoModeoperation
-> ByteStringinput string to encrypt/decrypt
-> IO ByteStringthe result string
cipherLBS lazilly encrypts or decrypts a stream of data. The input string doesn't necessarily have to be finite.
Produced by Haddock version 2.4.2