9 #ifndef BOTAN_P11_ECDSA_H__
10 #define BOTAN_P11_ECDSA_H__
12 #include <botan/build.h>
13 #if defined(BOTAN_HAS_ECDSA)
15 #include <botan/p11_ecc_key.h>
16 #include <botan/ecdsa.h>
25 class BOTAN_DLL PKCS11_ECDSA_PublicKey final :
public PKCS11_EC_PublicKey,
public virtual ECDSA_PublicKey
33 PKCS11_ECDSA_PublicKey(Session& session,
ObjectHandle handle)
34 : EC_PublicKey(), PKCS11_EC_PublicKey(session, handle)
42 PKCS11_ECDSA_PublicKey(Session& session,
const EC_PublicKeyImportProperties& props)
43 : EC_PublicKey(), PKCS11_EC_PublicKey(session, props)
46 inline std::string algo_name()
const override
52 ECDSA_PublicKey export_key()
const;
54 std::unique_ptr<PK_Ops::Verification>
55 create_verification_op(
const std::string& params,
56 const std::string& provider)
const override;
60 class BOTAN_DLL PKCS11_ECDSA_PrivateKey final :
public PKCS11_EC_PrivateKey
68 PKCS11_ECDSA_PrivateKey(Session& session,
ObjectHandle handle)
69 : PKCS11_EC_PrivateKey(session, handle)
77 PKCS11_ECDSA_PrivateKey(Session& session,
const EC_PrivateKeyImportProperties& props)
78 : PKCS11_EC_PrivateKey(session, props)
88 PKCS11_ECDSA_PrivateKey(Session& session,
const std::vector<uint8_t>& ec_params,
89 const EC_PrivateKeyGenerationProperties& props)
90 : PKCS11_EC_PrivateKey(session, ec_params, props)
93 inline std::string algo_name()
const override
99 ECDSA_PrivateKey export_key()
const;
101 secure_vector<uint8_t> private_key_bits()
const override;
103 bool check_key(RandomNumberGenerator&,
bool)
const override;
105 std::unique_ptr<PK_Ops::Signature>
106 create_signature_op(RandomNumberGenerator& rng,
107 const std::string& params,
108 const std::string& provider)
const override;
111 using PKCS11_ECDSA_KeyPair = std::pair<PKCS11_ECDSA_PublicKey, PKCS11_ECDSA_PrivateKey>;
119 BOTAN_DLL PKCS11_ECDSA_KeyPair generate_ecdsa_keypair(Session& session,
120 const EC_PublicKeyGenerationProperties& pub_props,
const EC_PrivateKeyGenerationProperties& priv_props);
CK_OBJECT_HANDLE ObjectHandle