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

#include <rsa_public_key.h>

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

Inherited by ccf::crypto::RSAKeyPair_OpenSSL.

Public Member Functions

 RSAPublicKey_OpenSSL (EVP_PKEY *key)
 
 RSAPublicKey_OpenSSL (const Pem &pem)
 
 RSAPublicKey_OpenSSL (RSAPublicKey_OpenSSL &&key)=default
 
 RSAPublicKey_OpenSSL (std::span< const uint8_t > der)
 
 RSAPublicKey_OpenSSL (const JsonWebKeyRSAPublic &jwk)
 
 ~RSAPublicKey_OpenSSL () override
 
size_t key_size () const override
 
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
 
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
 
Pem public_key_pem () const override
 
std::vector< uint8_t > public_key_der () const override
 
JsonWebKeyRSAPublic public_key_jwk (const std::optional< std::string > &kid=std::nullopt) const override
 
bool verify (const uint8_t *contents, size_t contents_size, const uint8_t *signature, size_t signature_size, MDType md_type, RSAPadding padding, size_t salt_length) override
 
bool verify_hash (const uint8_t *hash, size_t hash_size, const uint8_t *signature, size_t signature_size, MDType md_type, RSAPadding padding, size_t salt_length) override
 
OpenSSL::Unique_BIGNUM get_bn_param (const char *key_name) const
 
- Public Member Functions inherited from ccf::crypto::RSAPublicKey
virtual ~RSAPublicKey ()=default
 
- Public Member Functions inherited from ccf::crypto::PublicKey_OpenSSL
 PublicKey_OpenSSL ()=default
 
 PublicKey_OpenSSL (EVP_PKEY *key)
 
 PublicKey_OpenSSL (const Pem &pem)
 
void check_is_cose_compatible (int cose_alg)
 
 operator EVP_PKEY * () const
 
virtual ~PublicKey_OpenSSL ()
 

Protected Member Functions

 RSAPublicKey_OpenSSL ()
 

Additional Inherited Members

- Protected Attributes inherited from ccf::crypto::PublicKey_OpenSSL
EVP_PKEY * key = nullptr
 

Constructor & Destructor Documentation

◆ RSAPublicKey_OpenSSL() [1/6]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( )
protecteddefault

◆ RSAPublicKey_OpenSSL() [2/6]

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

◆ RSAPublicKey_OpenSSL() [3/6]

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

◆ RSAPublicKey_OpenSSL() [4/6]

ccf::crypto::RSAPublicKey_OpenSSL::RSAPublicKey_OpenSSL ( RSAPublicKey_OpenSSL &&  key)
default

◆ RSAPublicKey_OpenSSL() [5/6]

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

◆ RSAPublicKey_OpenSSL() [6/6]

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

◆ ~RSAPublicKey_OpenSSL()

ccf::crypto::RSAPublicKey_OpenSSL::~RSAPublicKey_OpenSSL ( )
overridedefault

Member Function Documentation

◆ 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.

◆ public_key_der()

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

Get the public key in DER format

Implements ccf::crypto::RSAPublicKey.

◆ public_key_jwk()

JsonWebKeyRSAPublic ccf::crypto::RSAPublicKey_OpenSSL::public_key_jwk ( 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

Implements ccf::crypto::RSAPublicKey.

◆ 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.

◆ 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,
RSAPadding  padding,
size_t  salt_length 
)
overridevirtual

◆ verify_hash()

bool ccf::crypto::RSAPublicKey_OpenSSL::verify_hash ( const uint8_t *  hash,
size_t  hash_size,
const uint8_t *  signature,
size_t  signature_size,
MDType  md_type,
RSAPadding  padding,
size_t  salt_length 
)
overridevirtual

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