24 return "[need OpenSSL or GnuTLS]";
43 gnutls_x509_dn_t issuer;
44 auto x = gnutls_x509_crt_get_issuer(&cert, &issuer);
45 if (x != GNUTLS_E_SUCCESS) {
51 x = gnutls_x509_dn_get_str(issuer, &name);
52 if (x != GNUTLS_E_SUCCESS) {
56 out.
append(
reinterpret_cast<const char *
>(name.data), name.size);
57 gnutls_free(name.data);
83 gnutls_x509_dn_t subject;
84 auto x = gnutls_x509_crt_get_subject(&cert, &subject);
85 if (x != GNUTLS_E_SUCCESS) {
91 x = gnutls_x509_dn_get_str(subject, &name);
92 if (x != GNUTLS_E_SUCCESS) {
96 out.
append(
reinterpret_cast<const char *
>(name.data), name.size);
97 gnutls_free(name.data);
112 const auto result = X509_check_issued(&issuer, &cert);
113 if (result == X509_V_OK)
116 Debug::Extra <<
"X509_check_issued() result: " << X509_verify_cert_error_string(result) <<
" (" << result <<
")" <<
119 const auto result = gnutls_x509_crt_check_issuer(&cert, &issuer);
136 os <<
"[no subject name]";
static std::ostream & Extra(std::ostream &)
SBuf & append(const SBuf &S)
#define DBG_PARSE_NOTE(x)
#define debugs(SECTION, LEVEL, CONTENT)
SBuf IssuerName(Certificate &)
The Issuer field of the given certificate (if found) or an empty SBuf.
SBuf SubjectName(Certificate &)
The SubjectName field of the given certificate (if found) or an empty SBuf.
bool IssuedBy(Certificate &cert, Certificate &issuer)
const char * ErrorString(const LibErrorCode code)
converts numeric LibErrorCode into a human-friendlier string
std::ostream & ReportAndForgetErrors(std::ostream &)
UniqueCString OneLineSummary(X509_NAME &)
a RAII wrapper for the memory-allocating flavor of X509_NAME_oneline()
void ForgetErrors()
Clear any errors accumulated by OpenSSL in its global storage.
const char * MissingLibraryError()
std::ostream & operator<<(std::ostream &os, Security::Certificate &cert)
reports a one-line gist of the Certificate Subject Name (for debugging)