I know that in CKKS (well, the same holds for BGV, FV, etc) the secret key is just a polynomial in \mathbb{Z}[X] / \langle X^N + 1 \rangle, that is, integer coefficients and degree smaller than N. Moreover, the coefficients are generally small (belonging to the set {-1, 0, 1} or following a discrete Gaussian with small variance).
Thus, I would like to print these coefficients.
If I try
CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
auto keys = cc->KeyGen();
std::cout << "Secret key: " << keys.secretKey << std::endl;
it just prints some memory address.
I also tried to use the methods defined in privatekey.h, but this gives me compilation errors.
For example, trying keys.secretKey.GetPrivateElement() produces the error message
error: ‘lbcrypto::PrivateKey<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint > > > {aka class std::shared_ptr<lbcrypto::PrivateKeyImpl<lbcrypto::DCRTPolyImpl<bigintdyn::mubintvec<bigintdyn::ubint > > > >}’ has no member named ‘GetPrivateElement’