Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Cipher = Cipher (Ptr EVP_CIPHER)
- data EVP_CIPHER
- withCipherPtr :: Cipher -> (Ptr EVP_CIPHER -> IO a) -> IO a
- cipherIvLength :: Cipher -> Int
- newtype CipherCtx = CipherCtx (ForeignPtr EVP_CIPHER_CTX)
- data EVP_CIPHER_CTX
- newCipherCtx :: IO CipherCtx
- withCipherCtxPtr :: CipherCtx -> (Ptr EVP_CIPHER_CTX -> IO a) -> IO a
- withNewCipherCtxPtr :: (Ptr EVP_CIPHER_CTX -> IO a) -> IO a
- data CryptoMode
- cipherSetPadding :: CipherCtx -> Int -> IO CipherCtx
- cipherInitBS :: Cipher -> ByteString -> ByteString -> CryptoMode -> IO CipherCtx
- cipherUpdateBS :: CipherCtx -> ByteString -> IO ByteString
- cipherFinalBS :: CipherCtx -> IO ByteString
- cipherStrictly :: CipherCtx -> ByteString -> IO ByteString
- cipherLazily :: CipherCtx -> ByteString -> IO ByteString
- newtype Digest = Digest (Ptr EVP_MD)
- data EVP_MD
- withMDPtr :: Digest -> (Ptr EVP_MD -> IO a) -> IO a
- newtype DigestCtx = DigestCtx (ForeignPtr EVP_MD_CTX)
- data EVP_MD_CTX
- withDigestCtxPtr :: DigestCtx -> (Ptr EVP_MD_CTX -> IO a) -> IO a
- digestUpdateBS :: DigestCtx -> ByteString -> IO ()
- digestFinalBS :: DigestCtx -> IO ByteString
- digestFinal :: DigestCtx -> IO String
- digestStrictly :: Digest -> ByteString -> IO DigestCtx
- digestLazily :: Digest -> ByteString -> IO DigestCtx
- newtype HmacCtx = HmacCtx (ForeignPtr HMAC_CTX)
- data HMAC_CTX
- withHmacCtxPtr :: HmacCtx -> (Ptr HMAC_CTX -> IO a) -> IO a
- hmacUpdateBS :: HmacCtx -> ByteString -> IO ()
- hmacFinalBS :: HmacCtx -> IO ByteString
- hmacLazily :: Digest -> ByteString -> ByteString -> IO HmacCtx
- newtype VaguePKey = VaguePKey (ForeignPtr EVP_PKEY)
- data EVP_PKEY
- class PKey k where
- createPKey :: (Ptr EVP_PKEY -> IO a) -> IO VaguePKey
- wrapPKeyPtr :: Ptr EVP_PKEY -> IO VaguePKey
- withPKeyPtr :: VaguePKey -> (Ptr EVP_PKEY -> IO a) -> IO a
- withPKeyPtr' :: PKey k => k -> (Ptr EVP_PKEY -> IO a) -> IO a
- unsafePKeyToPtr :: VaguePKey -> Ptr EVP_PKEY
- touchPKey :: VaguePKey -> IO ()
Documentation
Cipher
is an opaque object that represents an algorithm of
symmetric cipher.
data EVP_CIPHER Source #
withCipherPtr :: Cipher -> (Ptr EVP_CIPHER -> IO a) -> IO a Source #
cipherIvLength :: Cipher -> Int Source #
data EVP_CIPHER_CTX Source #
withCipherCtxPtr :: CipherCtx -> (Ptr EVP_CIPHER_CTX -> IO a) -> IO a Source #
withNewCipherCtxPtr :: (Ptr EVP_CIPHER_CTX -> IO a) -> IO a Source #
:: Cipher | |
-> ByteString | key |
-> ByteString | IV |
-> CryptoMode | |
-> IO CipherCtx |
cipherUpdateBS :: CipherCtx -> ByteString -> IO ByteString Source #
cipherFinalBS :: CipherCtx -> IO ByteString Source #
cipherStrictly :: CipherCtx -> ByteString -> IO ByteString Source #
cipherLazily :: CipherCtx -> ByteString -> IO ByteString Source #
Digest
is an opaque object that represents an algorithm of
message digest.
data EVP_MD_CTX Source #
withDigestCtxPtr :: DigestCtx -> (Ptr EVP_MD_CTX -> IO a) -> IO a Source #
digestUpdateBS :: DigestCtx -> ByteString -> IO () Source #
digestFinalBS :: DigestCtx -> IO ByteString Source #
digestStrictly :: Digest -> ByteString -> IO DigestCtx Source #
digestLazily :: Digest -> ByteString -> IO DigestCtx Source #
hmacUpdateBS :: HmacCtx -> ByteString -> IO () Source #
hmacFinalBS :: HmacCtx -> IO ByteString Source #
hmacLazily :: Digest -> ByteString -> ByteString -> IO HmacCtx Source #
VaguePKey is a ForeignPtr
to EVP_PKEY
, that is either public
key or a ker pair. We can't tell which at compile time.
toPKey :: k -> IO VaguePKey Source #
Wrap the key (i.g. RSA) into EVP_PKEY
.
fromPKey :: VaguePKey -> IO (Maybe k) Source #
Do the same as EVP_PKEY_size().
pkeyDefaultMD :: k -> IO Digest Source #
Return the default digesting algorithm for the key.