olp-cpp-sdk  1.19.0
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
olp::authentication::Crypto Class Reference

The cryptographic algoritms used by the library. More...

#include <Crypto.h>

Public Types

using Sha256Digest = std::array< unsigned char, Sha256DigestLength >
 An alias for the hash.
 

Static Public Member Functions

static Sha256Digest Sha256 (const std::vector< unsigned char > &content)
 Sha256 cryptographic function used to compute the hash value for a buffer. More...
 
static Sha256Digest HmacSha256 (const std::string &key, const std::string &message)
 HMAC function based on SHA-256 hash function. More...
 

Static Public Attributes

static const size_t Sha256DigestLength = 32
 The hash length after the SHA-256 encryption.
 

Detailed Description

The cryptographic algoritms used by the library.

Member Function Documentation

◆ HmacSha256()

static Sha256Digest olp::authentication::Crypto::HmacSha256 ( const std::string &  key,
const std::string &  message 
)
static

HMAC function based on SHA-256 hash function.

Parameters
keyA key.
messageA message.
Returns
An array of 32 bytes that represent a hash value.

◆ Sha256()

static Sha256Digest olp::authentication::Crypto::Sha256 ( const std::vector< unsigned char > &  content)
static

Sha256 cryptographic function used to compute the hash value for a buffer.

Parameters
contentA vector of unsigned chars for which the hash is computed.
Returns
An array of 32 bytes that represent a hash value.

The documentation for this class was generated from the following file: