|
Hermes 0.7.0
Linux game streaming host
|
Declarations for cryptography functions. More...
#include <array>#include <list>#include <openssl/evp.h>#include <openssl/rand.h>#include <openssl/sha.h>#include <openssl/x509.h>#include <nlohmann/json.hpp>#include "utility.h"Go to the source code of this file.
Classes | |
| struct | crypto::creds_t |
| struct | crypto::command_entry_t |
| struct | crypto::named_cert_t |
| class | crypto::cert_chain_t |
| class | crypto::cipher::cipher_t |
| class | crypto::cipher::ecb_t |
| class | crypto::cipher::gcm_t |
| class | crypto::cipher::cbc_t |
Typedefs | |
| using | crypto::sha256_t = std::array<std::uint8_t, SHA256_DIGEST_LENGTH> |
| using | crypto::aes_t = std::vector<std::uint8_t> |
| using | crypto::x509_t = util::safe_ptr<X509, X509_free> |
| using | crypto::x509_store_t = util::safe_ptr<X509_STORE, X509_STORE_free> |
| using | crypto::x509_store_ctx_t = util::safe_ptr<X509_STORE_CTX, X509_STORE_CTX_free> |
| using | crypto::cipher_ctx_t = util::safe_ptr<EVP_CIPHER_CTX, EVP_CIPHER_CTX_free> |
| using | crypto::md_ctx_t = util::safe_ptr<EVP_MD_CTX, md_ctx_destroy> |
| using | crypto::bio_t = util::safe_ptr<BIO, BIO_free_all> |
| using | crypto::pkey_t = util::safe_ptr<EVP_PKEY, EVP_PKEY_free> |
| using | crypto::pkey_ctx_t = util::safe_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_free> |
| using | crypto::bignum_t = util::safe_ptr<BIGNUM, BN_free> |
| using | crypto::p_named_cert_t = std::shared_ptr<named_cert_t> |
Enumerations | |
| enum class | crypto::PERM : uint32_t { _reserved = 1 , _input = _reserved << 8 , input_controller = _input << 0 , input_touch = _input << 1 , input_pen = _input << 2 , input_mouse = _input << 3 , input_kbd = _input << 4 , _all_inputs = input_controller | input_touch | input_pen | input_mouse | input_kbd , _operation = _input << 8 , clipboard_set = _operation << 0 , clipboard_read = _operation << 1 , file_upload = _operation << 2 , file_dwnload = _operation << 3 , server_cmd = _operation << 4 , _all_opeiations = clipboard_set | clipboard_read | file_upload | file_dwnload | server_cmd , _action = _operation << 8 , list = _action << 0 , view = _action << 1 , launch = _action << 2 , _allow_view = view | launch , _all_actions = list | view | launch , _default = view | list , _no = 0 , _all = _all_inputs | _all_opeiations | _all_actions } |
| The permissions of a client. More... | |
Functions | |
| void | crypto::md_ctx_destroy (EVP_MD_CTX *ctx) |
| constexpr PERM | crypto::operator& (PERM x, PERM y) |
| constexpr bool | crypto::operator! (PERM p) |
| sha256_t | crypto::hash (const std::string_view &plaintext) |
| Hashes the given plaintext using SHA-256. | |
| aes_t | crypto::gen_aes_key (const std::array< uint8_t, 16 > &salt, const std::string_view &pin) |
| x509_t | crypto::x509 (const std::string_view &x) |
| pkey_t | crypto::pkey (const std::string_view &k) |
| std::string | crypto::pem (x509_t &x509) |
| std::string | crypto::pem (pkey_t &pkey) |
| std::vector< uint8_t > | crypto::sign256 (const pkey_t &pkey, const std::string_view &data) |
| bool | crypto::verify256 (const x509_t &x509, const std::string_view &data, const std::string_view &signature) |
| creds_t | crypto::gen_creds (const std::string_view &cn, std::uint32_t key_bits) |
| std::string_view | crypto::signature (const x509_t &x) |
| std::string | crypto::rand (std::size_t bytes) |
| std::string | crypto::rand_alphabet (std::size_t bytes, const std::string_view &alphabet) |
| constexpr std::size_t | crypto::cipher::round_to_pkcs7_padded (std::size_t size) |
Variables | |
| constexpr std::size_t | crypto::cipher::tag_size = 16 |
Declarations for cryptography functions.
Definition in file crypto.h.
| using crypto::cipher_ctx_t = util::safe_ptr<EVP_CIPHER_CTX, EVP_CIPHER_CTX_free> |
| using crypto::md_ctx_t = util::safe_ptr<EVP_MD_CTX, md_ctx_destroy> |
| using crypto::p_named_cert_t = std::shared_ptr<named_cert_t> |
| using crypto::pkey_ctx_t = util::safe_ptr<EVP_PKEY_CTX, EVP_PKEY_CTX_free> |
| using crypto::pkey_t = util::safe_ptr<EVP_PKEY, EVP_PKEY_free> |
| using crypto::sha256_t = std::array<std::uint8_t, SHA256_DIGEST_LENGTH> |
| using crypto::x509_store_ctx_t = util::safe_ptr<X509_STORE_CTX, X509_STORE_CTX_free> |
| using crypto::x509_store_t = util::safe_ptr<X509_STORE, X509_STORE_free> |
|
strong |
| aes_t crypto::gen_aes_key | ( | const std::array< uint8_t, 16 > & | salt, |
| const std::string_view & | pin ) |
Definition at line 348 of file crypto.cpp.
| creds_t crypto::gen_creds | ( | const std::string_view & | cn, |
| std::uint32_t | key_bits ) |
Definition at line 459 of file crypto.cpp.
| sha256_t crypto::hash | ( | const std::string_view & | plaintext | ) |
Hashes the given plaintext using SHA-256.
| plaintext |
Definition at line 364 of file crypto.cpp.
| void crypto::md_ctx_destroy | ( | EVP_MD_CTX * | ctx | ) |
Definition at line 533 of file crypto.cpp.
| std::string crypto::pem | ( | pkey_t & | pkey | ) |
Definition at line 402 of file crypto.cpp.
| std::string crypto::pem | ( | x509_t & | x509 | ) |
Definition at line 392 of file crypto.cpp.
| pkey_t crypto::pkey | ( | const std::string_view & | k | ) |
Definition at line 381 of file crypto.cpp.
| std::string crypto::rand | ( | std::size_t | bytes | ) |
Definition at line 426 of file crypto.cpp.
| std::string crypto::rand_alphabet | ( | std::size_t | bytes, |
| const std::string_view & | alphabet ) |
Definition at line 537 of file crypto.cpp.
|
constexpr |
| std::vector< uint8_t > crypto::sign256 | ( | const pkey_t & | pkey, |
| const std::string_view & | data ) |
Definition at line 505 of file crypto.cpp.
| std::string_view crypto::signature | ( | const x509_t & | x | ) |
Definition at line 412 of file crypto.cpp.
| bool crypto::verify256 | ( | const x509_t & | x509, |
| const std::string_view & | data, | ||
| const std::string_view & | signature ) |
Definition at line 529 of file crypto.cpp.
| x509_t crypto::x509 | ( | const std::string_view & | x | ) |
Definition at line 370 of file crypto.cpp.