CCF
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
ccf::crypto::RSAKeyPair Class Referenceabstract

#include <rsa_key_pair.h>

Inherited by ccf::crypto::RSAKeyPair_OpenSSL.

Public Member Functions

 RSAKeyPair ()=default
 
 RSAKeyPair (const RSAKeyPair &)=delete
 
 RSAKeyPair (const Pem &pem)
 
virtual ~RSAKeyPair ()=default
 
virtual size_t key_size () const =0
 
virtual std::vector< uint8_t > rsa_oaep_unwrap (const std::vector< uint8_t > &input, const std::optional< std::vector< std::uint8_t > > &label=std::nullopt)=0
 
virtual Pem private_key_pem () const =0
 
virtual Pem public_key_pem () const =0
 
virtual std::vector< uint8_t > public_key_der () const =0
 
virtual std::vector< uint8_t > sign (std::span< const uint8_t > d, MDType md_type=MDType::NONE, size_t salt_length=0) const =0
 
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)=0
 
virtual bool verify (const std::vector< uint8_t > &contents, const std::vector< uint8_t > &signature, MDType md_type=MDType::NONE, size_t salt_length=0)
 
virtual JsonWebKeyRSAPrivate private_key_jwk_rsa (const std::optional< std::string > &kid=std::nullopt) const =0
 

Static Public Attributes

static constexpr size_t default_public_key_size = 2048
 
static constexpr size_t default_public_exponent = 65537
 

Constructor & Destructor Documentation

◆ RSAKeyPair() [1/3]

ccf::crypto::RSAKeyPair::RSAKeyPair ( )
default

◆ RSAKeyPair() [2/3]

ccf::crypto::RSAKeyPair::RSAKeyPair ( const RSAKeyPair )
delete

◆ RSAKeyPair() [3/3]

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

◆ ~RSAKeyPair()

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

Member Function Documentation

◆ key_size()

virtual size_t ccf::crypto::RSAKeyPair::key_size ( ) const
pure virtual

◆ private_key_jwk_rsa()

virtual JsonWebKeyRSAPrivate ccf::crypto::RSAKeyPair::private_key_jwk_rsa ( const std::optional< std::string > &  kid = std::nullopt) const
pure virtual

◆ private_key_pem()

virtual Pem ccf::crypto::RSAKeyPair::private_key_pem ( ) const
pure virtual

Get the private key in PEM format

Implemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ public_key_der()

virtual std::vector< uint8_t > ccf::crypto::RSAKeyPair::public_key_der ( ) const
pure virtual

Get the public key in DER format

Implemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ public_key_pem()

virtual Pem ccf::crypto::RSAKeyPair::public_key_pem ( ) const
pure virtual

Get the public key in PEM format

Implemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ rsa_oaep_unwrap()

virtual std::vector< uint8_t > ccf::crypto::RSAKeyPair::rsa_oaep_unwrap ( const std::vector< uint8_t > &  input,
const std::optional< std::vector< std::uint8_t > > &  label = std::nullopt 
)
pure virtual

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

Implemented in ccf::crypto::RSAKeyPair_OpenSSL.

◆ sign()

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

◆ verify() [1/2]

virtual bool ccf::crypto::RSAKeyPair::verify ( const std::vector< uint8_t > &  contents,
const std::vector< uint8_t > &  signature,
MDType  md_type = MDType::NONE,
size_t  salt_length = 0 
)
inlinevirtual

◆ verify() [2/2]

virtual bool ccf::crypto::RSAKeyPair::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 
)
pure virtual

Member Data Documentation

◆ default_public_exponent

constexpr size_t ccf::crypto::RSAKeyPair::default_public_exponent = 65537
staticconstexpr

◆ default_public_key_size

constexpr size_t ccf::crypto::RSAKeyPair::default_public_key_size = 2048
staticconstexpr

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