-
Notifications
You must be signed in to change notification settings - Fork 23
QuantumGate::UUID::Create
Karel Donk edited this page Jun 15, 2018
·
3 revisions
Creates a random UUID.
static std::tuple<bool, UUID, std::optional<PeerKeys>>
Create(const UUID::Type type, const UUID::SignAlgorithm salg) noexcept;
Name | Description |
---|---|
type |
The type of UUID to create. See QuantumGate::UUID::Type for details. |
salg |
The digital signature algorithm to use. See QuantumGate::UUID::SignAlgorithm for details. This parameter is only relevant when the type is QuantumGate::UUID::Type::Peer . |
Returns a std::tuple
containing a bool
value indicating whether or not the operation was successful (true
if so), the created QuantumGate::UUID
and optionally (when the UUID type is QuantumGate::UUID::Type::Peer
) a QuantumGate::PeerKeys
object containing a public/private key-pair matching the UUID.
auto [success, uuid, keys] =
QuantumGate::UUID::Create(QuantumGate::UUID::Type::Peer,
QuantumGate::UUID::SignAlgorithm::EDDSA_ED25519);
if (success)
{
std::cout << "Created peer UUID " << uuid << "\r\n";
}
else
{
std::cout << "Failed to create peer UUID\r\n";
}