CCF
|
#include <public_key.h>
Inherits ccf::crypto::PublicKey.
Inherited by ccf::crypto::KeyPair_OpenSSL, and ccf::crypto::RSAPublicKey_OpenSSL.
Public Member Functions | |
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 Pem | public_key_pem () const override |
virtual std::vector< uint8_t > | public_key_der () const 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 |
![]() | |
bool | verify (const uint8_t *contents, size_t contents_size, const uint8_t *sig, size_t sig_size, MDType md_type=MDType::NONE) |
Static Public Member Functions | |
static int | get_openssl_group_id (CurveID gid) |
Protected Member Functions | |
PublicKey_OpenSSL () | |
Static Protected Member Functions | |
static std::vector< uint8_t > | ec_point_public_from_jwk (const JsonWebKeyECPublic &jwk) |
Protected Attributes | |
EVP_PKEY * | key = nullptr |
|
protecteddefault |
|
default |
ccf::crypto::PublicKey_OpenSSL::PublicKey_OpenSSL | ( | EVP_PKEY * | key | ) |
ccf::crypto::PublicKey_OpenSSL::PublicKey_OpenSSL | ( | const Pem & | pem | ) |
ccf::crypto::PublicKey_OpenSSL::PublicKey_OpenSSL | ( | std::span< const uint8_t > | der | ) |
ccf::crypto::PublicKey_OpenSSL::PublicKey_OpenSSL | ( | const JsonWebKeyECPublic & | jwk | ) |
|
virtual |
|
overridevirtual |
The x/y coordinates of the public key
Implements ccf::crypto::PublicKey.
Reimplemented in ccf::crypto::KeyPair_OpenSSL.
|
staticprotected |
|
overridevirtual |
int ccf::crypto::PublicKey_OpenSSL::get_openssl_group_id | ( | ) | const |
|
static |
|
inline |
|
overridevirtual |
Get the public key in DER format
Implements ccf::crypto::PublicKey.
Reimplemented in ccf::crypto::KeyPair_OpenSSL, ccf::crypto::RSAKeyPair_OpenSSL, and ccf::crypto::RSAPublicKey_OpenSSL.
|
overridevirtual |
Implements ccf::crypto::PublicKey.
|
overridevirtual |
Get the public key in PEM format
Implements ccf::crypto::PublicKey.
Reimplemented in ccf::crypto::KeyPair_OpenSSL, ccf::crypto::RSAKeyPair_OpenSSL, and ccf::crypto::RSAPublicKey_OpenSSL.
|
overridevirtual |
Get the raw bytes of the public key
Implements ccf::crypto::PublicKey.
Reimplemented in ccf::crypto::KeyPair_OpenSSL.
|
inlinevirtual |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
contents | Sequence of bytes that was signed |
signature | Signature as a sequence of bytes |
Reimplemented from ccf::crypto::PublicKey.
|
overridevirtual |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
contents | address of contents |
contents_size | size of contents |
sig | address of signature |
sig_size | size of signature |
md_type | Digest algorithm to use |
bytes | Buffer to write the hash to |
Implements ccf::crypto::PublicKey.
Reimplemented in ccf::crypto::KeyPair_OpenSSL.
|
virtual |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
contents | address of contents |
contents_size | size of contents |
sig | address of signature |
sig_size | size of signature |
md_type | Digest algorithm to use |
bytes | Buffer to write the hash to |
Implements ccf::crypto::PublicKey.
|
inline |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
contents | address of contents |
contents_size | size of contents |
sig | address of signature |
sig_size | size of signature |
md_type | Digest algorithm to use (derived from the public key if md_type == MDType::None). |
|
inlinevirtual |
Verify that a signature was produced on the hash of some contents with the private key associated with the public key held by the object.
hash | Hash of some content |
signature | Signature as a sequence of bytes |
md_type | Type of hash |
Reimplemented from ccf::crypto::PublicKey.
|
overridevirtual |
Verify that a signature was produced on the hash of some contents with the private key associated with the public key held by the object.
hash | Hash of some content |
hash_size | length of hash |
sig | Signature as a sequence of bytes |
sig_size | Length of sig |
md_type | Digest algorithm |
Implements ccf::crypto::PublicKey.
|
virtual |
Verify that a signature was produced on the hash of some contents with the private key associated with the public key held by the object.
hash | Hash of some content |
hash_size | length of hash |
sig | Signature as a sequence of bytes |
sig_size | Length of sig |
md_type | Digest algorithm |
Implements ccf::crypto::PublicKey.
|
protected |