File: examples.doco

package info (click to toggle)
qca2 2.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,884 kB
  • sloc: cpp: 59,224; ansic: 814; perl: 133; sh: 89; makefile: 34
file content (182 lines) | stat: -rw-r--r-- 3,666 bytes parent folder | download | duplicates (3)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/** \example aes-cmac.cpp 

This example shows how to implement a client side "provider".

There are three important parts to this:
 - the class derived from QCA::Provider (in this example called
 "ClientSideProvider"), that generates the context class
 - one or more context classes (in this example only one, implementing
 AES-CMAC, called "AESCMACContext")
 - a call to QCA::insertProvider, to add the QCA::Provider subclass
 into QCA

*/


/** \example base64test.cpp

The code below shows some simple operations on a QCA::Base64 object, converting
between QCA::SecureArray and QString.

*/


/** \example certtest.cpp

This example shows how QCA::Certificate and QCA::CertificateCollection
can be used. Note that the argument, if you provide it, must be a 
PEM encoded file collection.

*/


/** \example ciphertest.cpp

The code below shows the normal way to use the QCA::Cipher class.

*/


/* \example cmssigner/main.cpp

The code below shows how to use Cryptographic Message Syntax (CMS)
in a GUI application.

\include certitem.h
\include certitem.cpp
\include certviewdlg.h
\include certviewdlg.cpp
\include keyselectdlg.h
\include keyselectdlg.cpp
\include prompter.h
\include prompter.cpp

*/


/** \example eventhandlerdemo.cpp

The code below shows to implement a client side handler for
password / passphrase / PIN and token requests from QCA and any
associated providers.

*/


/** \example hashtest.cpp

The code below shows how to use the QCA::Hash class

*/


/** \example hextest.cpp

The code below shows some simple operations on a QCA::Hex object, converting
between QCA::SecureArray and QString.

*/


/** \example keyloader.cpp

The code below shows how to load a private key from a PEM format file,
including handling any requirement for a passphrase. This is done using
the QCA::KeyLoader class.

*/


/** \example mactest.cpp

The code below shows how to use the QCA::MessageAuthenticationCode class

*/


/** \example md5crypt.cpp

The code below shows how to calculate an md5crypt based password. This
code is compatible with the glibc code.

*/


/** \example providertest.cpp

The code below shows some simple operations on a QCA::Provider object, including
use of iterators and some member functions.

*/


/** \example publickeyexample.cpp

The code below shows how to do public key encryption, decryption,
signing and verification.
*/


/** \example randomtest.cpp

The code below shows the normal way to use the QCA::Random class.

*/


/** \example rsatest.cpp

The code below shows some of the capabilities for how to use
RSA. This example also shows how to export and import a key
to a file, using PEM encoding.

*/


/** \example saslserver.cpp

The code below shows how to create a SASL server.

*/


/** \example saslclient.cpp

The code below shows how to create a SASL client.

*/


/** \example sslservtest.cpp

The code below shows how to create an SSL server.

Note that this server returns a self-signed certificate
for "example.com", and that the certificate is expired.

The design used here only allows for one connection 
at a time. If you want to allow for more, you should
probably create a "TlsConnection" object that agregates
a QCA::TLS object and a QTcpSocket (plus a little bit of
state information) that handles a single connection. Then
just create a TlsConnection for each server connection.

*/

/** \example ssltest.cpp

The code below shows how to create an SSL client 

*/

/** \example tlssocket.cpp

The code below shows how to create a socket that can operate
over an Transport Layer Security (TLS, also known as SSL) connection.

\include tlssocket/tlssocket.h
\include tlssocket/main.cpp
*/