#include <public_key.h>
Inherited by ccf::crypto::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)=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 |
|
virtual Pem | public_key_pem () const =0 |
|
virtual std::vector< uint8_t > | public_key_der () const =0 |
|
virtual std::vector< uint8_t > | public_key_raw () const =0 |
|
virtual CurveID | get_curve_id () const =0 |
|
virtual Coordinates | coordinates () const =0 |
|
virtual JsonWebKeyECPublic | public_key_jwk (const std::optional< std::string > &kid=std::nullopt) const =0 |
|
◆ coordinates()
virtual Coordinates ccf::crypto::PublicKey::coordinates |
( |
| ) |
const |
|
pure virtual |
◆ get_curve_id()
virtual CurveID ccf::crypto::PublicKey::get_curve_id |
( |
| ) |
const |
|
pure virtual |
◆ public_key_der()
virtual std::vector< uint8_t > ccf::crypto::PublicKey::public_key_der |
( |
| ) |
const |
|
pure virtual |
◆ public_key_jwk()
virtual JsonWebKeyECPublic ccf::crypto::PublicKey::public_key_jwk |
( |
const std::optional< std::string > & |
kid = std::nullopt | ) |
const |
|
pure virtual |
◆ public_key_pem()
virtual Pem ccf::crypto::PublicKey::public_key_pem |
( |
| ) |
const |
|
pure virtual |
◆ public_key_raw()
virtual std::vector< uint8_t > ccf::crypto::PublicKey::public_key_raw |
( |
| ) |
const |
|
pure virtual |
◆ verify() [1/3]
virtual bool ccf::crypto::PublicKey::verify |
( |
const std::vector< uint8_t > & |
contents, |
|
|
const std::vector< uint8_t > & |
signature |
|
) |
| |
|
inlinevirtual |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
- Parameters
-
contents | Sequence of bytes that was signed |
signature | Signature as a sequence of bytes |
- Returns
- Whether the signature matches the contents and the key
Reimplemented in ccf::crypto::PublicKey_OpenSSL, and ccf::crypto::KeyPair_OpenSSL.
◆ verify() [2/3]
virtual bool ccf::crypto::PublicKey::verify |
( |
const uint8_t * |
contents, |
|
|
size_t |
contents_size, |
|
|
const uint8_t * |
sig, |
|
|
size_t |
sig_size, |
|
|
MDType |
md_type, |
|
|
HashBytes & |
bytes |
|
) |
| |
|
pure virtual |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
- Parameters
-
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 |
- Returns
- Whether the signature matches the contents and the key
Implemented in ccf::crypto::KeyPair_OpenSSL, ccf::crypto::PublicKey_OpenSSL, and ccf::crypto::PublicKey_OpenSSL.
◆ verify() [3/3]
bool ccf::crypto::PublicKey::verify |
( |
const uint8_t * |
contents, |
|
|
size_t |
contents_size, |
|
|
const uint8_t * |
sig, |
|
|
size_t |
sig_size, |
|
|
MDType |
md_type = MDType::NONE |
|
) |
| |
|
inline |
Verify that a signature was produced on contents with the private key associated with the public key held by the object.
- Parameters
-
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). |
- Returns
- Whether the signature matches the contents and the key
◆ verify_hash() [1/2]
virtual bool ccf::crypto::PublicKey::verify_hash |
( |
const std::vector< uint8_t > & |
hash, |
|
|
const std::vector< uint8_t > & |
signature, |
|
|
MDType |
md_type |
|
) |
| |
|
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.
- Parameters
-
hash | Hash of some content |
signature | Signature as a sequence of bytes |
md_type | Type of hash |
- Returns
- Whether the signature matches the hash and the key
Reimplemented in ccf::crypto::PublicKey_OpenSSL.
◆ verify_hash() [2/2]
virtual bool ccf::crypto::PublicKey::verify_hash |
( |
const uint8_t * |
hash, |
|
|
size_t |
hash_size, |
|
|
const uint8_t * |
sig, |
|
|
size_t |
sig_size, |
|
|
MDType |
md_type |
|
) |
| |
|
pure 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.
- Parameters
-
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 |
- Returns
- Whether the signature matches the hash and the key
Implemented in ccf::crypto::PublicKey_OpenSSL, and ccf::crypto::PublicKey_OpenSSL.
The documentation for this class was generated from the following file: