Not blocking, but I find the following API simpler to understand:
create_with_new_secret(unsigned int secret_size);
create_with_existing_secret(Secret const& secret);
Secret secret();
Of course, with this API the secret is no longer really "secret" (i.e. internal to the class), but I don't think it matters. If one has access to the class, then it doesn't really matter if one also has the secret (for our use cases at least).
Looks good.
Not blocking, but I find the following API simpler to understand:
create_ with_new_ secret( unsigned int secret_size); with_existing_ secret( Secret const& secret);
create_
Secret secret();
Of course, with this API the secret is no longer really "secret" (i.e. internal to the class), but I don't think it matters. If one has access to the class, then it doesn't really matter if one also has the secret (for our use cases at least).