xref: /freebsd/contrib/bearssl/samples/README.txt (revision 2aaf9152a852aba9eb2036b95f4948ee77988826)
1*0957b409SSimon J. GerratyThis directory contains sample code for using BearSSL.
2*0957b409SSimon J. Gerraty
3*0957b409SSimon J. Gerratyclient_basic.c
4*0957b409SSimon J. Gerraty
5*0957b409SSimon J. Gerraty   A sample client code, that connects to a server, performs a SSL
6*0957b409SSimon J. Gerraty   handshake, sends a basic HTTP GET request, and dumps the complete
7*0957b409SSimon J. Gerraty   answer on stdout.
8*0957b409SSimon J. Gerraty
9*0957b409SSimon J. Gerraty   Compile it against BearSSL headers (in the ../inc directory) and
10*0957b409SSimon J. Gerraty   library (libbearssl.a). This code will validate the server
11*0957b409SSimon J. Gerraty   certificate against two hardcoded trust anchors.
12*0957b409SSimon J. Gerraty
13*0957b409SSimon J. Gerratyserver_basic.c
14*0957b409SSimon J. Gerraty
15*0957b409SSimon J. Gerraty   A sample SSL server, that serves one client at a time. It reads a
16*0957b409SSimon J. Gerraty   single HTTP request (that it does not really parse; it just waits for
17*0957b409SSimon J. Gerraty   the two successive line endings that mark the end of the request),
18*0957b409SSimon J. Gerraty   and pushes a basic response.
19*0957b409SSimon J. Gerraty
20*0957b409SSimon J. Gerraty   Compile it against BearSSL headers (in the ../inc directory) and
21*0957b409SSimon J. Gerraty   library (libbearssl.a). Depending on compilation options (see the
22*0957b409SSimon J. Gerraty   code), it will use one of several certificate chains, that exercise
23*0957b409SSimon J. Gerraty   various combinations of RSA and EC keys and signatures. These
24*0957b409SSimon J. Gerraty   certificate chains link to the trust anchors that are hardcoded
25*0957b409SSimon J. Gerraty   in client_basic.c, so the sample client and the sample server can
26*0957b409SSimon J. Gerraty   be tested against each other.
27*0957b409SSimon J. Gerraty
28*0957b409SSimon J. Gerratycustom_profile.c
29*0957b409SSimon J. Gerraty
30*0957b409SSimon J. Gerraty   A sample C source file that shows how to write your own client or
31*0957b409SSimon J. Gerraty   server profiles (selections of cipher suites and algorithms).
32*0957b409SSimon J. Gerraty
33*0957b409SSimon J. Gerraty
34*0957b409SSimon J. GerratyThe .pem files are certificate and keys corresponding to the chains
35*0957b409SSimon J. Gerratyand anchors used by the sample client and server. They are provided
36*0957b409SSimon J. Gerratyfor reference only; these files are not used by the examples.
37