Template Class KeyPair
Defined in File keypair.h
Page Contents
Template Parameter Order
class Element
Class Documentation
-
template<class Element>
class lbcrypto::KeyPair Container holding the public key and the matching secret (private) key produced by key generation.
- Template Parameters
Element – a ring element.
Public Functions
-
inline KeyPair(const PublicKey<Element> &a, const PrivateKey<Element> &b)
Constructs a key pair from existing shared pointers to a public key and a secret key.
- Parameters
a – the public key
b – the secret key
-
inline explicit KeyPair(PublicKeyImpl<Element> *a = nullptr, PrivateKeyImpl<Element> *b = nullptr)
Constructs a key pair that takes ownership of raw key pointers; by default it creates an empty pair.
- Parameters
a – raw pointer to a public key (ownership is transferred); nullptr for an empty public key
b – raw pointer to a secret key (ownership is transferred); nullptr for an empty secret key
-
inline bool good() const
Checks whether both keys of the pair are present.
- Returns
true if both the public key and the secret key are non-null