Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 78 lines (69 sloc) 2.462 kb
d8a6a59 @phonohawk Initial import
authored
1 {- -*- haskell -*- -}
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
2
06ad781 @phonohawk Bump version to 0.10.1.4
authored
3 -- |HsOpenSSL is an OpenSSL binding for Haskell. It can generate RSA
4 -- and DSA keys, read and write PEM files, generate message digests,
5 -- sign and verify messages, encrypt and decrypt messages.
6 --
7 -- Please note that this project has started at the time when there
8 -- were no pure-Haskell implementations of TLS. Now there is tls
9 -- package (<http://hackage.haskell.org/package/tls>), which looks
10 -- pretty saner than HsOpenSSL especially for initialisation and error
11 -- handlings. So PHO (the initial author of HsOpenSSL) highly
12 -- encourages you to use and improve the tls package instead as long
13 -- as possible.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
14 --
15 -- Features that aren't (yet) supported:
16 --
78e1a9d @phonohawk Doc fix for Haddock 2.x
authored
17 -- [/SSL network connection/] ssl(3) functionalities aren't fully
18 -- covered yet. See "OpenSSL.Session".
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
19 --
c0c99a5 @phonohawk The BIGNUM type should not be exposed to users. Expose BigNum instead.
authored
20 -- [/Complete coverage of Low-level API to symmetric ciphers/] Only
21 -- high-level APIs (EVP and BIO) are fully available. But I believe
22 -- no one will be lost without functions like @DES_set_odd_parity@.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
23 --
24 -- [/Low-level API to asymmetric ciphers/] Only a high-level API
25 -- (EVP) is available. But I believe no one will complain about the
26 -- absence of functions like @RSA_public_encrypt@.
27 --
70b5802 @phonohawk Release: HsOpenSSL 0.2
authored
28 -- [/Key generation of Diffie-Hellman algorithm/] Only RSA and DSA
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
29 -- keys can currently be generated.
30 --
d145e51 @phonohawk cleanup
authored
31 -- [/X.509 v3 extension handling/] It should be supported in the
2e1ce26 @phonohawk I think I have entirely written the document.
authored
32 -- future.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
33 --
c0c99a5 @phonohawk The BIGNUM type should not be exposed to users. Expose BigNum instead.
authored
34 -- [/Low-level API to message digest functions/] Just use EVP
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
35 -- instead of something like @MD5_Update@.
36 --
78e1a9d @phonohawk Doc fix for Haddock 2.x
authored
37 -- [/API to PKCS#12 functionality/] It should be covered someday.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
38 --
2e1ce26 @phonohawk I think I have entirely written the document.
authored
39 -- [/BIO/] BIO isn't needed because we are Haskell hackers. Though
40 -- HsOpenSSL itself uses BIO internally.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
41 --
42 -- [/ENGINE cryptographic module/] The default implementations work
43 -- very well, don't they?
44
45 #include "HsOpenSSL.h"
46
d8a6a59 @phonohawk Initial import
authored
47 module OpenSSL
6423c00 @phonohawk OpenSSL.X509.Revocation
authored
48 ( withOpenSSL
d8a6a59 @phonohawk Initial import
authored
49 )
50 where
51
52 import OpenSSL.SSL
53
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
54
55 foreign import ccall "HsOpenSSL_setupMutex"
56 setupMutex :: IO ()
57
58
59 -- |Computation of @'withOpenSSL' action@ initializes the OpenSSL
b0e452c @phonohawk Small doc fix
authored
60 -- library and computes @action@. Every applications that use
61 -- HsOpenSSL must wrap any operations related to OpenSSL with
62 -- 'withOpenSSL', or they might crash.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
63 --
64 -- > module Main where
65 -- > import OpenSSL
66 -- >
67 -- > main :: IO ()
68 -- > main = withOpenSSL $
69 -- > do ...
70 --
d8a6a59 @phonohawk Initial import
authored
71 withOpenSSL :: IO a -> IO a
72 withOpenSSL act
73 = do loadErrorStrings
014bbd0 @phonohawk RSA keys can now be written to an BIO.
authored
74 addAllAlgorithms
ed5b4c2 @agl Add the beginnings of session support
agl authored
75 libraryInit
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
76 setupMutex
d8a6a59 @phonohawk Initial import
authored
77 act
Something went wrong with that request. Please try again.