userver: crypto::PublicKey Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts

#include <userver/crypto/public_key.hpp>

Public Types

using NativeType = EVP_PKEY
 
using ModulusView = utils::StrongTypedef< class ModulusTag, std::string_view >
 Modulus wrapper.
 
using ExponentView = utils::StrongTypedef< class ExponentTag, std::string_view >
 Exponent wrapper.
 
using CoordinateView = utils::StrongTypedef< class CoordinateTag, std::string_view >
 
using CurveTypeView = utils::StrongTypedef< class CurveTypeTag, std::string_view >
 

Public Member Functions

NativeType * GetNative () const noexcept
 
 operator bool () const noexcept
 

Static Public Member Functions

static PublicKey LoadFromString (std::string_view key)
 
static PublicKey LoadFromCertificate (const Certificate &cert)
 
static PublicKey LoadRSAFromComponents (ModulusView modulus, ExponentView exponent)
 
static PublicKey LoadECFromComponents (CurveTypeView curve, CoordinateView x, CoordinateView y)
 

Detailed Description

Loaded into memory public key

Definition at line 21 of file public_key.hpp.

Member Typedef Documentation

◆ CoordinateView

using crypto::PublicKey::CoordinateView = utils::StrongTypedef<class CoordinateTag, std::string_view>

Definition at line 32 of file public_key.hpp.

◆ CurveTypeView

using crypto::PublicKey::CurveTypeView = utils::StrongTypedef<class CurveTypeTag, std::string_view>

Definition at line 35 of file public_key.hpp.

◆ ExponentView

using crypto::PublicKey::ExponentView = utils::StrongTypedef<class ExponentTag, std::string_view>

Exponent wrapper.

Definition at line 29 of file public_key.hpp.

◆ ModulusView

using crypto::PublicKey::ModulusView = utils::StrongTypedef<class ModulusTag, std::string_view>

Modulus wrapper.

Definition at line 26 of file public_key.hpp.

◆ NativeType

using crypto::PublicKey::NativeType = EVP_PKEY

Definition at line 23 of file public_key.hpp.

Member Function Documentation

◆ GetNative()

NativeType * crypto::PublicKey::GetNative ( ) const
inlinenoexcept

Definition at line 40 of file public_key.hpp.

◆ LoadECFromComponents()

static PublicKey crypto::PublicKey::LoadECFromComponents ( CurveTypeView  curve,
CoordinateView  x,
CoordinateView  y 
)
static

Creates EC PublicKey from components

Exceptions
crypto::KeyParseErrorif failed to load the key.

◆ LoadFromCertificate()

static PublicKey crypto::PublicKey::LoadFromCertificate ( const Certificate cert)
static

Extracts PublicKey from certificate.

Exceptions
crypto::KeyParseErrorif failed to load the key.

◆ LoadFromString()

static PublicKey crypto::PublicKey::LoadFromString ( std::string_view  key)
static

Accepts a string that contains a certificate or public key, checks that it's correct, loads it into OpenSSL structures and returns as a PublicKey variable.

Exceptions
crypto::KeyParseErrorif failed to load the key.

◆ LoadRSAFromComponents()

static PublicKey crypto::PublicKey::LoadRSAFromComponents ( ModulusView  modulus,
ExponentView  exponent 
)
static

Creates RSA PublicKey from components

Exceptions
crypto::KeyParseErrorif failed to load the key.

◆ operator bool()

crypto::PublicKey::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 41 of file public_key.hpp.


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