userver: userver/crypto/verifiers.hpp File Reference
Loading...
Searching...
No Matches
verifiers.hpp File Reference

Detailed Description

Digital signature verifiers.

Definition in file verifiers.hpp.

Go to the source code of this file.

#include <initializer_list>
#include <memory>
#include <string>
#include <string_view>
#include <userver/crypto/basic_types.hpp>
#include <userver/crypto/certificate.hpp>
#include <userver/crypto/exception.hpp>
#include <userver/crypto/public_key.hpp>
#include <userver/utils/flags.hpp>
+ Include dependency graph for verifiers.hpp:
+ This graph shows which files directly or indirectly include this file:

Classes

class  crypto::Verifier
 Base verifier class. More...
 
class  crypto::VerifierNone
 "none" algorithm verifier More...
 
class  crypto::HmacShaVerifier< bits >
 HMAC-SHA verifier. More...
 
class  crypto::DsaVerifier< type, bits >
 Generic verifier for asymmetric cryptography. More...
 
class  crypto::CmsVerifier
 

Namespaces

namespace  crypto
 Cryptography support.
 

Typedefs

using crypto::weak::VerifierRs1 = DsaVerifier<DsaType::kRsa, DigestSize::k160>
 Verifies RSASSA signature using SHA-1 and PKCS1 padding.
 
using crypto::weak::VerifierPs1 = DsaVerifier<DsaType::kRsaPss, DigestSize::k160>
 
Verifies HMAC SHA MAC.
using crypto::VerifierHs1 = HmacShaVerifier<DigestSize::k160>
 
using crypto::VerifierHs256 = HmacShaVerifier<DigestSize::k256>
 
using crypto::VerifierHs384 = HmacShaVerifier<DigestSize::k384>
 
using crypto::VerifierHs512 = HmacShaVerifier<DigestSize::k512>
 
Verifies RSASSA signature using SHA-2 and PKCS1 padding.
using crypto::VerifierRs256 = DsaVerifier<DsaType::kRsa, DigestSize::k256>
 
using crypto::VerifierRs384 = DsaVerifier<DsaType::kRsa, DigestSize::k384>
 
using crypto::VerifierRs512 = DsaVerifier<DsaType::kRsa, DigestSize::k512>
 
Verifies ECDSA as per RFC7518.

OpenSSL generates ECDSA signatures in ASN.1/DER format, RFC7518 specifies signature as a concatenation of zero-padded big-endian (R, S) values.

using crypto::VerifierEs256 = DsaVerifier<DsaType::kEc, DigestSize::k256>
 
using crypto::VerifierEs384 = DsaVerifier<DsaType::kEc, DigestSize::k384>
 
using crypto::VerifierEs512 = DsaVerifier<DsaType::kEc, DigestSize::k512>
 
Verifies RSASSA signature using SHA-2 and PSS padding as per RFC7518.

JWA specifications require using MGF1 function with the same hash function as for the digest and salt length to be the same size as the hash output.

using crypto::VerifierPs256 = DsaVerifier<DsaType::kRsaPss, DigestSize::k256>
 
using crypto::VerifierPs384 = DsaVerifier<DsaType::kRsaPss, DigestSize::k384>
 
using crypto::VerifierPs512 = DsaVerifier<DsaType::kRsaPss, DigestSize::k512>
 

Typedef Documentation

◆ VerifierPs1

using crypto::weak::VerifierPs1 = DsaVerifier<DsaType::kRsaPss, DigestSize::k160>

Verifies RSASSA signature using SHA-1 and PSS padding.

JWA specifications require using MGF1 function with the same hash function as for the digest and salt length to be the same size as the hash output.

Definition at line 154 of file verifiers.hpp.

◆ VerifierRs1

using crypto::weak::VerifierRs1 = DsaVerifier<DsaType::kRsa, DigestSize::k160>

Verifies RSASSA signature using SHA-1 and PKCS1 padding.

Definition at line 148 of file verifiers.hpp.