I am using a openssl EVP_PKEY_sign where the signature buffer size is already known and can be allocated using a vector.
EVP_PKEY_sign
size_t SignatureLength;