Skip to content

Commit cfac7e0

Browse files
committed
Add signing keys to avoid having a copy in every application
1 parent dd01612 commit cfac7e0

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ set(HEADER_FILES
3131
misc/math.h
3232
misc/multiarray.h
3333
misc/parseerror.h
34+
misc/signingkeys.h
3435
misc/traits.h
3536
misc/levenshtein.h
3637
misc/verification.h

misc/signingkeys.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#ifndef CPP_UTILITIES_MISC_SIGNINGKEYS_H
2+
#define CPP_UTILITIES_MISC_SIGNINGKEYS_H
3+
4+
#include <array>
5+
#include <string_view>
6+
7+
namespace CppUtilities {
8+
9+
/*!
10+
* \brief Contains signing keys for verifying releases via OpenSSL or stsigtool.
11+
* \remarks
12+
* - Checkout the header file `verification.h` for verification with OpenSSL.
13+
* - Checkout the Syncthing library contained in Syncthing Tray for verification with stsigtool.
14+
* - This function is experimental and might be changed in incompatible ways (API and ABI wise) or be completely removed
15+
* in further minor/patch releases.
16+
*/
17+
namespace SigningKeys {
18+
19+
// clang-format off
20+
constexpr auto stsigtool = std::array<std::string_view, 1>{
21+
std::string_view(
22+
R"(-----BEGIN EC PUBLIC KEY-----
23+
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBzGxkQSS43eE4r+A7HjlcEch5apsn
24+
fKOgJWaRE2TOD9dNoBO2RSaJEAzzOXg2BPMsiPdr+Ty99FZtX8fmIcgJHGoB3sE1
25+
PmSOaw3YWAXrHUYslrVRJI4iYCLuT4qjFMHgmqvphEE/zGDZ5Tyu6FwVlSjCO4Yy
26+
FdsjpzKV6nrX6EsK++o=
27+
-----END EC PUBLIC KEY-----
28+
)")
29+
};
30+
31+
constexpr auto openssl = std::array<std::string_view, 1>{
32+
std::string_view(
33+
R"(-----BEGIN EC PUBLIC KEY-----
34+
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAWJAn1E7ZE5Q6H69oaV5sqCIppJdg
35+
4bXDan9dJv6GOg70/t7q2CvwcwUXhV4FvCZxCHo25+rWYINfqKU2Utul8koAx8tK
36+
59ohfOzI63I+CC76GfX41uRGU0P5i6hS7o/hgBLiVXqT0FgS2BMfmnLMUvUjqnI2
37+
YQM7C55/5BM5Vrblkow=
38+
-----END EC PUBLIC KEY-----
39+
)")
40+
};
41+
// clang-format on
42+
43+
} // namespace SigningKeys
44+
} // namespace CppUtilities
45+
46+
#endif // CPP_UTILITIES_MISC_SIGNINGKEYS_H

0 commit comments

Comments
 (0)