#include <folly/ssl/OpenSSLCertUtils.h>
#include <folly/FileUtil.h>
#include <folly/ScopeGuard.h>
#include <folly/String.h>
#include <folly/ssl/OpenSSLPtrTypes.h>
namespace folly {
namespace ssl {
namespace {
std::string getOpenSSLErrorString(unsigned long err) { … }
std::string asn1ToString(ASN1_STRING* a) { … }
std::string getExtOid(X509_EXTENSION* extension) { … }
std::string getExtData(X509_EXTENSION* extension) { … }
}
Optional<std::string> OpenSSLCertUtils::getCommonName(X509& x509) { … }
std::vector<std::string> OpenSSLCertUtils::getSubjectAltNames(X509& x509) { … }
Optional<std::string> OpenSSLCertUtils::getSubject(X509& x509) { … }
Optional<std::string> OpenSSLCertUtils::getIssuer(X509& x509) { … }
std::vector<std::string> OpenSSLCertUtils::getExtension(
X509& x509, folly::StringPiece oid) { … }
std::vector<std::pair<std::string, std::string>>
OpenSSLCertUtils::getAllExtensions(X509& x509) { … }
folly::Optional<std::string> OpenSSLCertUtils::toString(X509& x509) { … }
std::string OpenSSLCertUtils::getNotAfterTime(X509& x509) { … }
std::string OpenSSLCertUtils::getNotBeforeTime(X509& x509) { … }
std::chrono::system_clock::time_point OpenSSLCertUtils::asnTimeToTimepoint(
const ASN1_TIME* asnTime) { … }
std::string OpenSSLCertUtils::getDateTimeStr(const ASN1_TIME* time) { … }
X509UniquePtr OpenSSLCertUtils::derDecode(ByteRange range) { … }
std::unique_ptr<IOBuf> OpenSSLCertUtils::derEncode(X509& x509) { … }
std::vector<X509UniquePtr> OpenSSLCertUtils::readCertsFromBuffer(
ByteRange range) { … }
std::array<uint8_t, SHA_DIGEST_LENGTH> OpenSSLCertUtils::getDigestSha1(
X509& x509) { … }
std::array<uint8_t, SHA256_DIGEST_LENGTH> OpenSSLCertUtils::getDigestSha256(
X509& x509) { … }
X509StoreUniquePtr OpenSSLCertUtils::readStoreFromFile(std::string caFile) { … }
X509StoreUniquePtr OpenSSLCertUtils::readStoreFromBuffer(ByteRange certRange) { … }
}
}