Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 80 lines (71 sloc) 2.629 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
1acab7b @phonohawk Added a note about security consideration.
authored
11 -- handlings. So PHO (the initial author of HsOpenSSL) wants to
12 -- encourage you to use and improve the tls package instead as long as
13 -- possible. The only problem is that the tls package has not received
14 -- as much review as OpenSSL from cryptography specialists yet, thus
15 -- we can't assume it's secure enough.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
16 --
17 -- Features that aren't (yet) supported:
18 --
78e1a9d @phonohawk Doc fix for Haddock 2.x
authored
19 -- [/SSL network connection/] ssl(3) functionalities aren't fully
20 -- covered yet. See "OpenSSL.Session".
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
21 --
c0c99a5 @phonohawk The BIGNUM type should not be exposed to users. Expose BigNum instead.
authored
22 -- [/Complete coverage of Low-level API to symmetric ciphers/] Only
23 -- high-level APIs (EVP and BIO) are fully available. But I believe
24 -- no one will be lost without functions like @DES_set_odd_parity@.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
25 --
26 -- [/Low-level API to asymmetric ciphers/] Only a high-level API
27 -- (EVP) is available. But I believe no one will complain about the
28 -- absence of functions like @RSA_public_encrypt@.
29 --
70b5802 @phonohawk Release: HsOpenSSL 0.2
authored
30 -- [/Key generation of Diffie-Hellman algorithm/] Only RSA and DSA
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
31 -- keys can currently be generated.
32 --
d145e51 @phonohawk cleanup
authored
33 -- [/X.509 v3 extension handling/] It should be supported in the
2e1ce26 @phonohawk I think I have entirely written the document.
authored
34 -- future.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
35 --
c0c99a5 @phonohawk The BIGNUM type should not be exposed to users. Expose BigNum instead.
authored
36 -- [/Low-level API to message digest functions/] Just use EVP
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
37 -- instead of something like @MD5_Update@.
38 --
78e1a9d @phonohawk Doc fix for Haddock 2.x
authored
39 -- [/API to PKCS#12 functionality/] It should be covered someday.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
40 --
2e1ce26 @phonohawk I think I have entirely written the document.
authored
41 -- [/BIO/] BIO isn't needed because we are Haskell hackers. Though
42 -- HsOpenSSL itself uses BIO internally.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
43 --
44 -- [/ENGINE cryptographic module/] The default implementations work
45 -- very well, don't they?
46
47 #include "HsOpenSSL.h"
48
d8a6a59 @phonohawk Initial import
authored
49 module OpenSSL
6423c00 @phonohawk OpenSSL.X509.Revocation
authored
50 ( withOpenSSL
d8a6a59 @phonohawk Initial import
authored
51 )
52 where
53
54 import OpenSSL.SSL
55
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
56
57 foreign import ccall "HsOpenSSL_setupMutex"
58 setupMutex :: IO ()
59
60
61 -- |Computation of @'withOpenSSL' action@ initializes the OpenSSL
b0e452c @phonohawk Small doc fix
authored
62 -- library and computes @action@. Every applications that use
63 -- HsOpenSSL must wrap any operations related to OpenSSL with
64 -- 'withOpenSSL', or they might crash.
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
65 --
66 -- > module Main where
67 -- > import OpenSSL
68 -- >
69 -- > main :: IO ()
70 -- > main = withOpenSSL $
71 -- > do ...
72 --
d8a6a59 @phonohawk Initial import
authored
73 withOpenSSL :: IO a -> IO a
74 withOpenSSL act
75 = do loadErrorStrings
014bbd0 @phonohawk RSA keys can now be written to an BIO.
authored
76 addAllAlgorithms
ed5b4c2 @agl Add the beginnings of session support
agl authored
77 libraryInit
df27224 @phonohawk Implemented OpenSSL.EVP.Base64 / Buried OpenSSL.BIO
authored
78 setupMutex
d8a6a59 @phonohawk Initial import
authored
79 act
Something went wrong with that request. Please try again.