CCF
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
ccf::crypto::RSAPublicKey_OpenSSL Class Reference

#include <rsa_public_key.h>

Inherits ccf::crypto::PublicKey_OpenSSL, and ccf::crypto::RSAPublicKey.

Inherited by ccf::crypto::RSAKeyPair_OpenSSL.

Public Member Functions

 RSAPublicKey_OpenSSL ()=default
 
 RSAPublicKey_OpenSSL (EVP_PKEY *c)
 
 RSAPublicKey_OpenSSL (const Pem &pem)
 
 RSAPublicKey_OpenSSL (std::span< const uint8_t > der)
 
 RSAPublicKey_OpenSSL (const JsonWebKeyRSAPublic &jwk)
 
virtual ~RSAPublicKey_OpenSSL ()=default
 
virtual size_t key_size () const override
 
virtual std::vector< uint8_t > rsa_oaep_wrap (const uint8_t *input, size_t input_size, const uint8_t *label=nullptr, size_t label_size=0) override
 
virtual std::vector< uint8_t > rsa_oaep_wrap (const std::vector< uint8_t > &input, const std::optional< std::vector< std::uint8_t > > &label=std::nullopt) override
 
virtual Pem public_key_pem () const override
 
virtual std::vector< uint8_t > public_key_der () const override
 
virtual bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *signature, size_t signature_size, MDType md_type=MDType::NONE, size_t salt_length=0) override
 
virtual bool verify_pkcs1 (const uint8_t *contents, size_t contents_size, const uint8_t *signature, size_t signature_size, MDType md_type=MDType::NONE) override
 
virtual Components components () const override
 
OpenSSL::Unique_BIGNUM get_bn_param (const char *key_name) const
 
virtual JsonWebKeyRSAPublic public_key_jwk_rsa (const std::optional< std::string > &kid=std::nullopt) const override
 
- Public Member Functions inherited from ccf::crypto::PublicKey_OpenSSL
 PublicKey_OpenSSL (PublicKey_OpenSSL &&key)=default
 
 PublicKey_OpenSSL (EVP_PKEY *key)
 
 PublicKey_OpenSSL (const Pem &pem)
 
 PublicKey_OpenSSL (std::span< const uint8_t > der)
 
 PublicKey_OpenSSL (const JsonWebKeyECPublic &jwk)
 
virtual ~PublicKey_OpenSSL ()
 
virtual bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type, HashBytes &bytes) override
 
virtual bool verify_hash (const uint8_t *hash, size_t hash_size, const uint8_t *sig, size_t sig_size, MDType md_type) override
 
virtual std::vector< uint8_t > public_key_raw () const override
 
virtual CurveID get_curve_id () const override
 
int get_openssl_group_id () const
 
 operator EVP_PKEY * () const
 
virtual Coordinates coordinates () const override
 
virtual JsonWebKeyECPublic public_key_jwk (const std::optional< std::string > &kid=std::nullopt) const override
 
virtual bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type, HashBytes &bytes)=0
 
bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type=MDType::NONE)
 
virtual bool verify (const std::vector< uint8_t > &contents, const std::vector< uint8_t > &signature)
 
virtual bool verify_hash (const std::vector< uint8_t > &hash, const std::vector< uint8_t > &signature, MDType md_type)
 
virtual bool verify_hash (const uint8_t *hash, size_t hash_size, const uint8_t *sig, size_t sig_size, MDType md_type)=0
 
- Public Member Functions inherited from ccf::crypto::PublicKey
bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type=MDType::NONE)
 
- Public Member Functions inherited from ccf::crypto::RSAPublicKey
 RSAPublicKey ()=default
 
virtual ~RSAPublicKey ()=default
 
 RSAPublicKey (const Pem &pem)
 
 RSAPublicKey (const std::vector< uint8_t > &der)
 
 RSAPublicKey (const JsonWebKeyRSAPublic &jwk)
 

Static Public Member Functions

static std::vector< uint8_t > bn_bytes (const BIGNUM *bn)
 
- Static Public Member Functions inherited from ccf::crypto::PublicKey_OpenSSL
static int get_openssl_group_id (CurveID gid)
 

Static Protected Member Functions

static std::pair< std::vector< uint8_t >, std::vector< uint8_t > > rsa_public_raw_from_jwk (const JsonWebKeyRSAPublic &jwk)
 
- Static Protected Member Functions inherited from ccf::crypto::PublicKey_OpenSSL
static std::vector< uint8_t > ec_point_public_from_jwk (const JsonWebKeyECPublic &jwk)
 

Additional Inherited Members

- Protected Member Functions inherited from ccf::crypto::PublicKey_OpenSSL
 PublicKey_OpenSSL ()
 
- Protected Attributes inherited from ccf::crypto::PublicKey_OpenSSL
EVP_PKEY * key = nullptr
 

Constructor & Destructor Documentation

◆ RSAPublicKey_OpenSSL() [1/5]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( )
default

◆ RSAPublicKey_OpenSSL() [2/5]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( EVP_PKEY *  c)

◆ RSAPublicKey_OpenSSL() [3/5]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( const Pem pem)

◆ RSAPublicKey_OpenSSL() [4/5]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( std::span< const uint8_t >  der)

◆ RSAPublicKey_OpenSSL() [5/5]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( const JsonWebKeyRSAPublic jwk)

◆ ~RSAPublicKey_OpenSSL()

virtual ccf::crypto::RSAPublicKey_OpenSSL::~RSAPublicKey_OpenSSL ( )
virtualdefault

Member Function Documentation

◆ bn_bytes()

std::vector< uint8_t > ccf::crypto::RSAPublicKey_OpenSSL::bn_bytes ( const BIGNUM *  bn)
static

◆ components()

RSAPublicKey::Components ccf::crypto::RSAPublicKey_OpenSSL::components ( ) const
overridevirtual

◆ get_bn_param()

Unique_BIGNUM ccf::crypto::RSAPublicKey_OpenSSL::get_bn_param ( const char *  key_name) const

◆ key_size()

size_t ccf::crypto::RSAPublicKey_OpenSSL::key_size ( ) const
overridevirtual

Get the key size in bits

Implements ccf::crypto::RSAPublicKey.

Reimplemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ public_key_der()

std::vector< uint8_t > ccf::crypto::RSAPublicKey_OpenSSL::public_key_der ( ) const
overridevirtual

Get the public key in DER format

Reimplemented from ccf::crypto::PublicKey_OpenSSL.

Reimplemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ public_key_jwk_rsa()

JsonWebKeyRSAPublic ccf::crypto::RSAPublicKey_OpenSSL::public_key_jwk_rsa ( const std::optional< std::string > &  kid = std::nullopt) const
overridevirtual

Get the public key in JWK format

Implements ccf::crypto::RSAPublicKey.

◆ public_key_pem()

Pem ccf::crypto::RSAPublicKey_OpenSSL::public_key_pem ( ) const
overridevirtual

Get the public key in PEM format

Reimplemented from ccf::crypto::PublicKey_OpenSSL.

Reimplemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ rsa_oaep_wrap() [1/2]

std::vector< uint8_t > ccf::crypto::RSAPublicKey_OpenSSL::rsa_oaep_wrap ( const std::vector< uint8_t > &  input,
const std::optional< std::vector< std::uint8_t > > &  label = std::nullopt 
)
overridevirtual

Wrap data using RSA-OAEP-256 (CKM_RSA_PKCS_OAEP)

Parameters
inputRaw data to wrap
labelOptional string used as label during wrapping
Returns
Wrapped data

Implements ccf::crypto::RSAPublicKey.

◆ rsa_oaep_wrap() [2/2]

std::vector< uint8_t > ccf::crypto::RSAPublicKey_OpenSSL::rsa_oaep_wrap ( const uint8_t *  input,
size_t  input_size,
const uint8_t *  label = nullptr,
size_t  label_size = 0 
)
overridevirtual

Wrap data using RSA-OAEP-256 (CKM_RSA_PKCS_OAEP)

Parameters
inputPointer to raw data to wrap
input_sizeSize of raw data
labelOptional string used as label during wrapping
label_sizeSize of label
Returns
Wrapped data

Implements ccf::crypto::RSAPublicKey.

◆ rsa_public_raw_from_jwk()

std::pair< std::vector< uint8_t >, std::vector< uint8_t > > ccf::crypto::RSAPublicKey_OpenSSL::rsa_public_raw_from_jwk ( const JsonWebKeyRSAPublic jwk)
staticprotected

◆ verify()

bool ccf::crypto::RSAPublicKey_OpenSSL::verify ( const uint8_t *  contents,
size_t  contents_size,
const uint8_t *  signature,
size_t  signature_size,
MDType  md_type = MDType::NONE,
size_t  salt_length = 0 
)
overridevirtual

◆ verify_pkcs1()

bool ccf::crypto::RSAPublicKey_OpenSSL::verify_pkcs1 ( const uint8_t *  contents,
size_t  contents_size,
const uint8_t *  signature,
size_t  signature_size,
MDType  md_type = MDType::NONE 
)
overridevirtual

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