diff options
author | Jack Lloyd <[email protected]> | 2020-12-15 07:08:00 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-12-15 07:08:00 -0500 |
commit | 07b78b3f8d135c4d512644965e0c1599b227430d (patch) | |
tree | 12f09664ded94fb2df5bc7cb148c2df69fd21968 /src/lib/pubkey | |
parent | 972266811936d5e32860302542bfadc1c0d3e553 (diff) |
Make EC_*Key constructors protected
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/ecc_key/ecc_key.h | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/src/lib/pubkey/ecc_key/ecc_key.h b/src/lib/pubkey/ecc_key/ecc_key.h index ec2b5f9be..629270890 100644 --- a/src/lib/pubkey/ecc_key/ecc_key.h +++ b/src/lib/pubkey/ecc_key/ecc_key.h @@ -28,22 +28,6 @@ namespace Botan { class BOTAN_PUBLIC_API(2,0) EC_PublicKey : public virtual Public_Key { public: - /** - * Create a public key. - * @param dom_par EC domain parameters - * @param pub_point public point on the curve - */ - EC_PublicKey(const EC_Group& dom_par, - const PointGFp& pub_point); - - /** - * Load a public key. - * @param alg_id the X.509 algorithm identifier - * @param key_bits DER encoded public key bits - */ - EC_PublicKey(const AlgorithmIdentifier& alg_id, - const std::vector<uint8_t>& key_bits); - EC_PublicKey(const EC_PublicKey& other) = default; EC_PublicKey& operator=(const EC_PublicKey& other) = default; virtual ~EC_PublicKey() = default; @@ -108,6 +92,22 @@ class BOTAN_PUBLIC_API(2,0) EC_PublicKey : public virtual Public_Key size_t estimated_strength() const override; protected: + /** + * Create a public key. + * @param dom_par EC domain parameters + * @param pub_point public point on the curve + */ + EC_PublicKey(const EC_Group& dom_par, + const PointGFp& pub_point); + + /** + * Load a public key. + * @param alg_id the X.509 algorithm identifier + * @param key_bits DER encoded public key bits + */ + EC_PublicKey(const AlgorithmIdentifier& alg_id, + const std::vector<uint8_t>& key_bits); + EC_PublicKey() : m_domain_params{}, m_public_key{}, m_domain_encoding(EC_DOMPAR_ENC_EXPLICIT) {} @@ -124,6 +124,19 @@ class BOTAN_PUBLIC_API(2,0) EC_PrivateKey : public virtual EC_PublicKey, public virtual Private_Key { public: + secure_vector<uint8_t> private_key_bits() const override; + + /** + * Get the private key value of this key object. + * @result the private key value of this key object + */ + const BigInt& private_value() const; + + EC_PrivateKey(const EC_PrivateKey& other) = default; + EC_PrivateKey& operator=(const EC_PrivateKey& other) = default; + ~EC_PrivateKey() = default; + + protected: /* * If x=0, creates a new private key in the domain * using the given rng. If with_modular_inverse is set, @@ -150,18 +163,6 @@ class BOTAN_PUBLIC_API(2,0) EC_PrivateKey : public virtual EC_PublicKey, const secure_vector<uint8_t>& key_bits, bool with_modular_inverse=false); - secure_vector<uint8_t> private_key_bits() const override; - - /** - * Get the private key value of this key object. - * @result the private key value of this key object - */ - const BigInt& private_value() const; - - EC_PrivateKey(const EC_PrivateKey& other) = default; - EC_PrivateKey& operator=(const EC_PrivateKey& other) = default; - ~EC_PrivateKey() = default; - protected: EC_PrivateKey() = default; BigInt m_private_key; |