Kurlyk
Loading...
Searching...
No Matches
pkce.hpp File Reference

Provides PKCE (Proof Key for Code Exchange) utilities per RFC 7636. More...

#include "base64_url.hpp"
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <limits>
#include <stdexcept>
#include <string>
#include <vector>
#include <cstdint>

Go to the source code of this file.

Classes

class  kurlyk::utils::PkcePair
 Stores PKCE verifier and challenge values. More...

Namespaces

namespace  kurlyk
 Primary namespace for the Kurlyk library, encompassing initialization, request management, and utility functions.
namespace  kurlyk::utils
namespace  kurlyk::utils::detail

Macros

#define KURLYK_HEADER_KURLYK_UTILS_PKCE_HPP_INCLUDED

Functions

void kurlyk::utils::detail::random_bytes (uint8_t *data, std::size_t size)
 Fills a byte buffer with cryptographically secure random data.
std::vector< uint8_t > kurlyk::utils::detail::sha256 (const void *data, std::size_t size)
 Calculates a SHA-256 digest.
std::string kurlyk::utils::generate_code_verifier (std::size_t length=64)
 Generates a cryptographically strong PKCE code verifier.
std::string kurlyk::utils::make_s256_code_challenge (const std::string &verifier)
 Creates an S256 code challenge from a verifier.
PkcePair kurlyk::utils::make_pkce_pair ()
 Creates a PKCE pair with a freshly generated verifier.

Detailed Description

Provides PKCE (Proof Key for Code Exchange) utilities per RFC 7636.

Definition in file pkce.hpp.

Macro Definition Documentation

◆ KURLYK_HEADER_KURLYK_UTILS_PKCE_HPP_INCLUDED

#define KURLYK_HEADER_KURLYK_UTILS_PKCE_HPP_INCLUDED

Definition at line 3 of file pkce.hpp.