CCF
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ccf::crypto::RSAPublicKey Class Referenceabstract

#include <rsa_public_key.h>

Inherited by ccf::crypto::RSAPublicKey_OpenSSL.

Classes

struct  Components
 

Public Member Functions

 RSAPublicKey ()=default
 
virtual ~RSAPublicKey ()=default
 
 RSAPublicKey (const Pem &pem)
 
 RSAPublicKey (const std::vector< uint8_t > &der)
 
 RSAPublicKey (const JsonWebKeyRSAPublic &jwk)
 
virtual size_t key_size () const =0
 
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)=0
 
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)=0
 
virtual Pem public_key_pem () const =0
 
virtual std::vector< uint8_t > public_key_der () 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_legth=0)=0
 
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)=0
 
virtual Components components () const =0
 
virtual JsonWebKeyRSAPublic public_key_jwk_rsa (const std::optional< std::string > &kid=std::nullopt) const =0
 

Constructor & Destructor Documentation

◆ RSAPublicKey() [1/4]

ccf::crypto::RSAPublicKey::RSAPublicKey ( )
default

◆ ~RSAPublicKey()

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

◆ RSAPublicKey() [2/4]

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

Construct from PEM

◆ RSAPublicKey() [3/4]

ccf::crypto::RSAPublicKey::RSAPublicKey ( const std::vector< uint8_t > &  der)

Construct from DER

◆ RSAPublicKey() [4/4]

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

Construct from JWK

Member Function Documentation

◆ components()

virtual Components ccf::crypto::RSAPublicKey::components ( ) const
pure virtual

◆ key_size()

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

Get the key size in bits

Implemented in ccf::crypto::RSAKeyPair_OpenSSL, and ccf::crypto::RSAPublicKey_OpenSSL.

◆ public_key_der()

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

Get the public key in DER format

Implemented in ccf::crypto::RSAKeyPair_OpenSSL, and ccf::crypto::RSAPublicKey_OpenSSL.

◆ public_key_jwk_rsa()

virtual JsonWebKeyRSAPublic ccf::crypto::RSAPublicKey::public_key_jwk_rsa ( const std::optional< std::string > &  kid = std::nullopt) const
pure virtual

Get the public key in JWK format

Implemented in ccf::crypto::RSAPublicKey_OpenSSL.

◆ public_key_pem()

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

Get the public key in PEM format

Implemented in ccf::crypto::RSAKeyPair_OpenSSL, and ccf::crypto::RSAPublicKey_OpenSSL.

◆ rsa_oaep_wrap() [1/2]

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

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

Implemented in ccf::crypto::RSAPublicKey_OpenSSL.

◆ rsa_oaep_wrap() [2/2]

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

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

Implemented in ccf::crypto::RSAPublicKey_OpenSSL.

◆ verify()

virtual bool ccf::crypto::RSAPublicKey::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_legth = 0 
)
pure virtual

◆ verify_pkcs1()

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

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