Mercurial > trustbridge
annotate ui/sslhelp.h @ 1071:fc4e1fe4e4d4
(issue116) Sign binaries with test certificate if RELESE_BUILD option is not used
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 10 Sep 2014 17:52:11 +0200 |
parents | 5ebee91c0bb8 |
children | c8a6a3e6bdeb |
rev | line source |
---|---|
467
5ebee91c0bb8
Add missing include guard
Andre Heinecke <aheinecke@intevation.de>
parents:
464
diff
changeset
|
1 #ifndef SSLHELP_H |
5ebee91c0bb8
Add missing include guard
Andre Heinecke <aheinecke@intevation.de>
parents:
464
diff
changeset
|
2 #define SSLHELP_H |
452
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
3 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
4 * Software engineering by Intevation GmbH |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
5 * |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
6 * This file is Free Software under the GNU GPL (v>=2) |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
8 * See LICENSE.txt for details. |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
9 */ |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
10 |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
11 |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
12 /** |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
13 * @file sslhelp.h |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
14 * @brief Helper functions to combine Qt with Polarssl |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
15 */ |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
16 #include <polarssl/error.h> |
464
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
17 #include <polarssl/pk.h> |
452
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
18 |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
19 #include <QString> |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
20 |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
21 /** @brief get a human readable error message for a polarssl return code |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
22 * |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
23 * @param [in] ret A polarssl error code |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
24 * @returns A QString representation of that error |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
25 */ |
f8b480b08532
Factor out polarssl error handling and start new sslhelp file
Andre Heinecke <aheinecke@intevation.de>
parents:
diff
changeset
|
26 QString getPolarSSLErrorMsg(int ret); |
464
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
27 |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
28 /** @brief calculate the sha256 of the bytearray data |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
29 * |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
30 * @param [in] data The data to hash |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
31 * @returns the sha256sum of the data |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
32 */ |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
33 QByteArray sha256sum(const QByteArray& data); |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
34 |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
35 /** @brief Create a RSA signature fur a sha256 hashsum |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
36 * |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
37 * @param [in] hash the hash to sign. |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
38 * @param [in] pk the key to use. |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
39 * @returns the signature of the data or an empty byte array on error |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
40 */ |
2e100d3e414a
Add helper functions for sha256 sum and rsa signing
Andre Heinecke <aheinecke@intevation.de>
parents:
452
diff
changeset
|
41 QByteArray rsaSignSHA256Hash(const QByteArray& hash, pk_context *pk); |
467
5ebee91c0bb8
Add missing include guard
Andre Heinecke <aheinecke@intevation.de>
parents:
464
diff
changeset
|
42 #endif // SSLHELP_H |