This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
/
index.html
112 lines (91 loc) · 2.88 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<title>OpenSSL.NET</title>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-3313431-2");
pageTracker._trackPageview();
} catch(err) {}
</script>
</head>
<body>
<h1>OpenSSL.NET</h1>
<p>
A managed <a href="http://www.openssl.org">OpenSSL</a> wrapper written in C#
for the 2.0 .NET Framework that exposes both the
<a href="http://www.openssl.org/docs/crypto/crypto.html">Crypto API</a> and
the <a href="http://www.openssl.org/docs/ssl/ssl.html">SSL API</a>.
This a must for .NET developers that need crypto but don't want to use
Microsoft's SSPI.
This wrapper is based on version 1.0.0d of libeay32.dll and ssleay32.dll.
</p>
<p>
A big thanks goes to Ben Henderson for contributing the wrapper for the
SSL API!
</p>
<h3>Download</h3>
The latest version (0.5-rc1) can be downloaded
<a href="http://sourceforge.net/projects/openssl-net/files/">here</a>.
<h3>Installation</h3>
Make sure you have libeay32.dll and ssleay32.dll in the current working
directory of your application or in your PATH.
In your .NET project, add a reference to the ManagedOpenSsl.dll assembly.
<h3>Documentation</h3>
Take a look at the low-level C API
<a href="http://www.openssl.org/docs">documentation</a>
over at the openssl.org.
<ul>
<li><a href="README">README</a></li>
<li><a href="INSTALL">INSTALL</a></li>
<li><a href="CHANGES">CHANGES</a></li>
<li><a href="TODO">TODO</a></li>
<li><a href="COPYING">COPYING</a></li>
<li><a href="LICENSE">LICENSE</a></li>
</ul>
<h4>Wrapper Example</h4>
<p>
The following is a partial example to show the general pattern of wrapping
onto the C API.
</p>
Take DSA and the following C prototypes:
<code>
<pre>
DSA * DSA_new(void);
void DSA_free(DSA *dsa);
int DSA_size(const DSA *dsa);
int DSA_generate_key(DSA *dsa);
int DSA_sign(int dummy, const unsigned char *dgst, int len,
unsigned char *sigret, unsigned int *siglen, DSA *dsa);
int DSA_verify(int dummy, const unsigned char *dgst, int len,
const unsigned char *sigbuf, int siglen, DSA *dsa);
</pre>
</code>
Which gets wrapped as something akin to:
<code>
<pre>
public class DSA : IDisposable
{
// calls DSA_new()
public DSA();
// calls DSA_free() as needed
~DSA();
// calls DSA_free() as needed
public void Dispose();
// returns DSA_size()
public int Size { get; }
// calls DSA_generate_key()
public void GenerateKeys();
// calls DSA_sign()
public byte[] Sign(byte[] msg);
// returns DSA_verify()
public bool Verify(byte[] msg, byte[] sig);
}
</pre>
</code>
</body>
</html>