|
8 | 8 | #include <openssl/rand.h> |
9 | 9 | #include <openssl/x509v3.h> |
10 | 10 | #include <algorithm> |
11 | | -#include <array> |
12 | 11 | #include <cstring> |
13 | | -#include <string_view> |
14 | 12 | #if OPENSSL_VERSION_MAJOR >= 3 |
15 | 13 | #include <openssl/core_names.h> |
16 | 14 | #include <openssl/params.h> |
@@ -1096,29 +1094,6 @@ BIOPointer X509View::getValidTo() const { |
1096 | 1094 | return bio; |
1097 | 1095 | } |
1098 | 1096 |
|
1099 | | -std::optional<std::string_view> X509View::getSignatureAlgorithm() const { |
1100 | | - if (cert_ == nullptr) return std::nullopt; |
1101 | | - int nid = X509_get_signature_nid(cert_); |
1102 | | - if (nid == NID_undef) return std::nullopt; |
1103 | | - const char* ln = OBJ_nid2ln(nid); |
1104 | | - if (ln == nullptr) return std::nullopt; |
1105 | | - return std::string_view(ln); |
1106 | | -} |
1107 | | - |
1108 | | -std::optional<std::string> X509View::getSignatureAlgorithmOID() const { |
1109 | | - if (cert_ == nullptr) return std::nullopt; |
1110 | | - const X509_ALGOR* alg = nullptr; |
1111 | | - X509_get0_signature(nullptr, &alg, cert_); |
1112 | | - if (alg == nullptr) return std::nullopt; |
1113 | | - const ASN1_OBJECT* obj = nullptr; |
1114 | | - X509_ALGOR_get0(&obj, nullptr, nullptr, alg); |
1115 | | - if (obj == nullptr) return std::nullopt; |
1116 | | - std::array<char, 128> buf{}; |
1117 | | - int len = OBJ_obj2txt(buf.data(), buf.size(), obj, 1); |
1118 | | - if (len < 0 || static_cast<size_t>(len) >= buf.size()) return std::nullopt; |
1119 | | - return std::string(buf.data(), static_cast<size_t>(len)); |
1120 | | -} |
1121 | | - |
1122 | 1097 | int64_t X509View::getValidToTime() const { |
1123 | 1098 | #ifdef OPENSSL_IS_BORINGSSL |
1124 | 1099 | // Boringssl does not implement ASN1_TIME_to_tm in a public way, |
|
0 commit comments