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

#include <rsa_key_pair.h>

Inherits ccf::crypto::RSAPublicKey_OpenSSL, and ccf::crypto::RSAKeyPair.

Public Member Functions

 RSAKeyPair_OpenSSL (size_t public_key_size, size_t public_exponent)
 
 RSAKeyPair_OpenSSL (const Pem &pem)
 
 RSAKeyPair_OpenSSL (const JsonWebKeyRSAPrivate &jwk)
 
 ~RSAKeyPair_OpenSSL () override=default
 
 RSAKeyPair_OpenSSL (EVP_PKEY *k)
 
Pem private_key_pem () const override
 
std::vector< uint8_t > private_key_der () const override
 
JsonWebKeyRSAPrivate private_key_jwk (const std::optional< std::string > &kid=std::nullopt) const override
 
std::vector< uint8_t > sign (std::span< const uint8_t > d, MDType md_type=MDType::NONE, size_t salt_length=0) const override
 
std::vector< uint8_t > rsa_oaep_unwrap (const std::vector< uint8_t > &input, const std::optional< std::vector< std::uint8_t > > &label=std::nullopt) 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
 
- Public Member Functions inherited from ccf::crypto::RSAPublicKey_OpenSSL
 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 ()
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ RSAKeyPair_OpenSSL() [1/4]

ccf::crypto::RSAKeyPair_OpenSSL::RSAKeyPair_OpenSSL ( size_t  public_key_size,
size_t  public_exponent 
)

◆ RSAKeyPair_OpenSSL() [2/4]

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

◆ RSAKeyPair_OpenSSL() [3/4]

ccf::crypto::RSAKeyPair_OpenSSL::RSAKeyPair_OpenSSL ( const JsonWebKeyRSAPrivate jwk)

◆ ~RSAKeyPair_OpenSSL()

ccf::crypto::RSAKeyPair_OpenSSL::~RSAKeyPair_OpenSSL ( )
overridedefault

◆ RSAKeyPair_OpenSSL() [4/4]

ccf::crypto::RSAKeyPair_OpenSSL::RSAKeyPair_OpenSSL ( EVP_PKEY *  k)

Member Function Documentation

◆ key_size()

size_t ccf::crypto::RSAKeyPair_OpenSSL::key_size ( ) const
inlineoverridevirtual

Get the key size in bits

Implements ccf::crypto::RSAPublicKey.

◆ private_key_der()

std::vector< uint8_t > ccf::crypto::RSAKeyPair_OpenSSL::private_key_der ( ) const
overridevirtual

◆ private_key_jwk()

JsonWebKeyRSAPrivate ccf::crypto::RSAKeyPair_OpenSSL::private_key_jwk ( const std::optional< std::string > &  kid = std::nullopt) const
overridevirtual

◆ private_key_pem()

Pem ccf::crypto::RSAKeyPair_OpenSSL::private_key_pem ( ) const
overridevirtual

◆ public_key_der()

std::vector< uint8_t > ccf::crypto::RSAKeyPair_OpenSSL::public_key_der ( ) const
inlineoverridevirtual

Get the public key in DER format

Implements ccf::crypto::RSAPublicKey.

◆ public_key_jwk()

JsonWebKeyRSAPublic ccf::crypto::RSAKeyPair_OpenSSL::public_key_jwk ( const std::optional< std::string > &  kid = std::nullopt) const
inlineoverridevirtual

Get the public key in JWK format

Implements ccf::crypto::RSAPublicKey.

◆ public_key_pem()

Pem ccf::crypto::RSAKeyPair_OpenSSL::public_key_pem ( ) const
inlineoverridevirtual

Get the public key in PEM format

Implements ccf::crypto::RSAPublicKey.

◆ rsa_oaep_unwrap()

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

Unwrap data using RSA-OAEP-256 (CKM_RSA_PKCS_OAEP)

Parameters
inputRaw data to unwrap
labelOptional string used as label during unwrapping
Returns
Unwrapped data

Implements ccf::crypto::RSAKeyPair.

◆ rsa_oaep_wrap() [1/2]

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

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::RSAKeyPair_OpenSSL::rsa_oaep_wrap ( const uint8_t *  input,
size_t  input_size,
const uint8_t *  label = nullptr,
size_t  label_size = 0 
)
inlineoverridevirtual

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.

◆ sign()

std::vector< uint8_t > ccf::crypto::RSAKeyPair_OpenSSL::sign ( std::span< const uint8_t >  d,
MDType  md_type = MDType::NONE,
size_t  salt_length = 0 
) const
overridevirtual

◆ verify()

bool ccf::crypto::RSAKeyPair_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 
)
inlineoverridevirtual

◆ verify_hash()

bool ccf::crypto::RSAKeyPair_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 
)
inlineoverridevirtual

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