HsOpenSSL-0.11.4.18: Partial OpenSSL binding for Haskell
Safe HaskellNone
LanguageHaskell2010

OpenSSL.EVP.Internal

Synopsis

Documentation

newtype Cipher #

Cipher is an opaque object that represents an algorithm of symmetric cipher.

Constructors

Cipher (Ptr EVP_CIPHER) 

withCipherPtr :: Cipher -> (Ptr EVP_CIPHER -> IO a) -> IO a #

newtype CipherCtx #

Constructors

CipherCtx (ForeignPtr EVP_CIPHER_CTX) 

withCipherCtxPtr :: CipherCtx -> (Ptr EVP_CIPHER_CTX -> IO a) -> IO a #

withNewCipherCtxPtr :: (Ptr EVP_CIPHER_CTX -> IO a) -> IO a #

data CryptoMode #

CryptoMode represents instruction to cipher and such like.

Constructors

Encrypt 
Decrypt 

cipherInitBS #

Arguments

:: Cipher 
-> ByteString

key

-> ByteString

IV

-> 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 is an opaque object that represents an algorithm of message digest.

Constructors

Digest (Ptr EVP_MD) 

data EVP_MD #

withMDPtr :: Digest -> (Ptr EVP_MD -> IO a) -> IO a #

newtype DigestCtx #

Constructors

DigestCtx (ForeignPtr 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 #

Constructors

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 is a ForeignPtr to EVP_PKEY, that is either public key or a ker pair. We can't tell which at compile time.

Constructors

VaguePKey (ForeignPtr EVP_PKEY) 

data EVP_PKEY #

class PKey k where #

Instances of class PKey can be converted back and forth to VaguePKey.

Methods

toPKey :: k -> IO VaguePKey #

Wrap the key (i.g. RSA) into EVP_PKEY.

fromPKey :: VaguePKey -> IO (Maybe k) #

Extract the concrete key from the EVP_PKEY. Returns Nothing if the type mismatches.

pkeySize :: k -> Int #

Do the same as EVP_PKEY_size().

pkeyDefaultMD :: k -> IO Digest #

Return the default digesting algorithm for the key.

Instances

Instances details
PKey RSAKeyPair # 
Instance details

Defined in OpenSSL.EVP.PKey

PKey RSAPubKey # 
Instance details

Defined in OpenSSL.EVP.PKey

PKey DSAKeyPair # 
Instance details

Defined in OpenSSL.EVP.PKey

PKey DSAPubKey # 
Instance details

Defined in OpenSSL.EVP.PKey

PKey SomeKeyPair # 
Instance details

Defined in OpenSSL.EVP.PKey

PKey SomePublicKey # 
Instance details

Defined in OpenSSL.EVP.PKey

createPKey :: (Ptr EVP_PKEY -> IO a) -> IO VaguePKey #

withPKeyPtr :: VaguePKey -> (Ptr EVP_PKEY -> IO a) -> IO a #

withPKeyPtr' :: PKey k => k -> (Ptr EVP_PKEY -> IO a) -> IO a #

touchPKey :: VaguePKey -> IO () #