NAP
opensslutils.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Local Includes
8 #include "signingscheme.h"
9 
10 // External Includes
11 #include <string>
12 #include <utility/dllexport.h>
13 
14 
15 namespace nap
16 {
17  namespace utility
18  {
27  bool NAPAPI createSignature(const std::string& privkey, const std::string& message, ESigningScheme scheme, std::string& outSignature);
28 
37  bool NAPAPI verifyMessage(const std::string& pubkey, const std::string& message, ESigningScheme scheme, const std::string& signature);
38 
46  bool NAPAPI generateRSAKey(unsigned int bits, std::string& outPrivKey, std::string& outPubKey);
47 
53  std::string NAPAPI sha256(const std::string& str);
54 
60  std::string NAPAPI encode64(const std::string& str);
61 
67  std::string NAPAPI decode64(const std::string& str);
68  }
69 }
nap::utility::sha256
std::string NAPAPI sha256(const std::string &str)
Generate a SHA256 hash of a string.
nap::utility::verifyMessage
bool NAPAPI verifyMessage(const std::string &pubkey, const std::string &message, ESigningScheme scheme, const std::string &signature)
nap::utility::decode64
std::string NAPAPI decode64(const std::string &str)
Decode a base64 string.
nap::utility::createSignature
bool NAPAPI createSignature(const std::string &privkey, const std::string &message, ESigningScheme scheme, std::string &outSignature)
nap::utility::encode64
std::string NAPAPI encode64(const std::string &str)
Encode a string to base64.
nap::utility::generateRSAKey
bool NAPAPI generateRSAKey(unsigned int bits, std::string &outPrivKey, std::string &outPubKey)
nap
Definition: templateapp.h:17
nap::ESigningScheme
ESigningScheme
Definition: signingscheme.h:14