proxygen
OpenSSLCertUtilsTest.cpp File Reference

Go to the source code of this file.

Classes

class  OpenSSLCertUtilsTest
 

Functions

 INSTANTIATE_TEST_CASE_P (OpenSSLCertUtilsTest, OpenSSLCertUtilsTest, Bool())
 
static folly::ssl::X509UniquePtr readCertFromFile (const std::string &filename)
 
static folly::ssl::X509UniquePtr readCertFromData (const folly::StringPiece data)
 
static void validateTestCertBundle (const std::vector< folly::ssl::X509UniquePtr > &certs)
 
static void validateTestCertWithSAN (X509 *x509)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509CN)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509Sans)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509IssuerAndSubject)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509Dates)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509Summary)
 
 TEST_P (OpenSSLCertUtilsTest, TestDerEncodeDecode)
 
 TEST_P (OpenSSLCertUtilsTest, TestDerDecodeJunkData)
 
 TEST_P (OpenSSLCertUtilsTest, TestDerDecodeTooShort)
 
 TEST_P (OpenSSLCertUtilsTest, TestReadCertsFromBuffer)
 
 TEST_P (OpenSSLCertUtilsTest, TestReadCertsFromMixedBuffer)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509Digest)
 
 TEST_P (OpenSSLCertUtilsTest, TestX509Store)
 
 TEST_P (OpenSSLCertUtilsTest, TestProcessMalformedCertBuf)
 
 TEST_P (OpenSSLCertUtilsTest, TestReadStoreDuplicate)
 

Variables

const char * kTestCertWithoutSan = "folly/io/async/test/certs/tests-cert.pem"
 
const char * kTestCa = "folly/io/async/test/certs/ca-cert.pem"
 
const std::string kTestKey
 
const std::string kTestCertWithSan
 
const std::string kTestCertBundle
 

Function Documentation

INSTANTIATE_TEST_CASE_P ( OpenSSLCertUtilsTest  ,
OpenSSLCertUtilsTest  ,
Bool()   
)
static folly::ssl::X509UniquePtr readCertFromData ( const folly::StringPiece  data)
static

Definition at line 157 of file OpenSSLCertUtilsTest.cpp.

References folly::Range< Iter >::data(), and folly::Range< Iter >::size().

Referenced by TEST_P().

158  {
159  folly::ssl::BioUniquePtr bio(BIO_new_mem_buf(data.data(), data.size()));
160  if (!bio) {
161  throw std::runtime_error("Couldn't create BIO");
162  }
164  PEM_read_bio_X509(bio.get(), nullptr, nullptr, nullptr));
165 }
std::unique_ptr< X509, X509Deleter > X509UniquePtr
std::unique_ptr< BIO, BioDeleter > BioUniquePtr
constexpr size_type size() const
Definition: Range.h:431
constexpr Iter data() const
Definition: Range.h:446
static folly::ssl::X509UniquePtr readCertFromFile ( const std::string filename)
static

Definition at line 144 of file OpenSSLCertUtilsTest.cpp.

Referenced by TEST_P().

144  {
145  folly::ssl::BioUniquePtr bio(BIO_new(BIO_s_file()));
146  if (!bio) {
147  throw std::runtime_error("Couldn't create BIO");
148  }
149 
150  if (BIO_read_filename(bio.get(), filename.c_str()) != 1) {
151  throw std::runtime_error("Couldn't read cert file: " + filename);
152  }
154  PEM_read_bio_X509(bio.get(), nullptr, nullptr, nullptr));
155 }
std::unique_ptr< X509, X509Deleter > X509UniquePtr
std::unique_ptr< BIO, BioDeleter > BioUniquePtr
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509CN   
)

Definition at line 189 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getCommonName(), folly::ssl::OpenSSLCertUtils::getSubjectAltNames(), kTestCertWithoutSan, and readCertFromFile().

189  {
191  EXPECT_NE(x509, nullptr);
192  auto identity = folly::ssl::OpenSSLCertUtils::getCommonName(*x509);
193  EXPECT_EQ(identity.value(), "Asox Company");
195  EXPECT_EQ(sans.size(), 0);
196 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const char * kTestCertWithoutSan
static folly::ssl::X509UniquePtr readCertFromFile(const std::string &filename)
static std::vector< std::string > getSubjectAltNames(X509 &x509)
static Optional< std::string > getCommonName(X509 &x509)
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509Sans   
)

Definition at line 198 of file OpenSSLCertUtilsTest.cpp.

References kTestCertWithSan, readCertFromData(), and validateTestCertWithSAN().

198  {
199  auto x509 = readCertFromData(kTestCertWithSan);
200  validateTestCertWithSAN(x509.get());
201 }
static void validateTestCertWithSAN(X509 *x509)
const std::string kTestCertWithSan
static folly::ssl::X509UniquePtr readCertFromData(const folly::StringPiece data)
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509IssuerAndSubject   
)

Definition at line 203 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getIssuer(), folly::ssl::OpenSSLCertUtils::getSubject(), kTestCertWithSan, and readCertFromData().

203  {
204  auto x509 = readCertFromData(kTestCertWithSan);
205  EXPECT_NE(x509, nullptr);
206  auto issuer = folly::ssl::OpenSSLCertUtils::getIssuer(*x509);
207  EXPECT_EQ(
208  issuer.value(),
209  "C = US, ST = CA, O = Asox, CN = Asox Certification Authority");
210  auto subj = folly::ssl::OpenSSLCertUtils::getSubject(*x509);
211  EXPECT_EQ(subj.value(), "C = US, O = Asox, CN = 127.0.0.1");
212 }
const std::string kTestCertWithSan
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static Optional< std::string > getSubject(X509 &x509)
static folly::ssl::X509UniquePtr readCertFromData(const folly::StringPiece data)
static Optional< std::string > getIssuer(X509 &x509)
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509Dates   
)

Definition at line 214 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getNotAfterTime(), folly::ssl::OpenSSLCertUtils::getNotBeforeTime(), kTestCertWithSan, and readCertFromData().

214  {
215  auto x509 = readCertFromData(kTestCertWithSan);
216  EXPECT_NE(x509, nullptr);
217  auto notBefore = folly::ssl::OpenSSLCertUtils::getNotBeforeTime(*x509);
218  EXPECT_EQ(notBefore, "Feb 13 23:21:03 2017 GMT");
219  auto notAfter = folly::ssl::OpenSSLCertUtils::getNotAfterTime(*x509);
220  EXPECT_EQ(notAfter, "Jul 1 23:21:03 2044 GMT");
221 }
const std::string kTestCertWithSan
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static folly::ssl::X509UniquePtr readCertFromData(const folly::StringPiece data)
static std::string getNotAfterTime(X509 &x509)
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
static std::string getNotBeforeTime(X509 &x509)
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509Summary   
)

Definition at line 223 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, kTestCertWithSan, readCertFromData(), and folly::ssl::OpenSSLCertUtils::toString().

223  {
224  auto x509 = readCertFromData(kTestCertWithSan);
225  EXPECT_NE(x509, nullptr);
226  auto summary = folly::ssl::OpenSSLCertUtils::toString(*x509);
227  EXPECT_EQ(
228  summary.value(),
229  " Version: 3 (0x2)\n Serial Number: 2 (0x2)\n"
230  " Issuer: C = US, ST = CA, O = Asox, CN = Asox Certification Authority\n"
231  " Validity\n Not Before: Feb 13 23:21:03 2017 GMT\n"
232  " Not After : Jul 1 23:21:03 2044 GMT\n"
233  " Subject: C = US, O = Asox, CN = 127.0.0.1\n"
234  " X509v3 extensions:\n"
235  " X509v3 Basic Constraints: \n"
236  " CA:FALSE\n"
237  " Netscape Comment: \n"
238  " OpenSSL Generated Certificate\n"
239  " X509v3 Subject Key Identifier: \n"
240  " 71:D6:49:9D:64:47:D7:1E:65:8B:1E:94:83:23:42:E1:F2:19:9F:C3\n"
241  " X509v3 Authority Key Identifier: \n"
242  " keyid:17:DF:29:09:29:BF:7B:9F:1A:7F:E9:46:49:C8:3B:ED:B3:B9:E8:7B\n\n"
243  " X509v3 Subject Alternative Name: \n"
244  " DNS:anotherexample.com, DNS:*.thirdexample.com\n"
245  " Authority Information Access: \n"
246  " CA Issuers - URI:https://phabricator.fb.com/diffusion/FBCODE/browse/master/ti/test_certs/ca_cert.pem?view=raw\n\n");
247 }
static folly::Optional< std::string > toString(X509 &x509)
const std::string kTestCertWithSan
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static folly::ssl::X509UniquePtr readCertFromData(const folly::StringPiece data)
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
TEST_P ( OpenSSLCertUtilsTest  ,
TestDerEncodeDecode   
)

Definition at line 249 of file OpenSSLCertUtilsTest.cpp.

References folly::ssl::OpenSSLCertUtils::derDecode(), folly::ssl::OpenSSLCertUtils::derEncode(), EXPECT_EQ, kTestCertWithSan, readCertFromData(), and folly::ssl::OpenSSLCertUtils::toString().

249  {
250  auto x509 = readCertFromData(kTestCertWithSan);
251 
252  auto der = folly::ssl::OpenSSLCertUtils::derEncode(*x509);
253  auto decoded = folly::ssl::OpenSSLCertUtils::derDecode(der->coalesce());
254 
255  EXPECT_EQ(
258 }
static folly::Optional< std::string > toString(X509 &x509)
const std::string kTestCertWithSan
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static X509UniquePtr derDecode(ByteRange)
static folly::ssl::X509UniquePtr readCertFromData(const folly::StringPiece data)
static std::unique_ptr< IOBuf > derEncode(X509 &)
TEST_P ( OpenSSLCertUtilsTest  ,
TestDerDecodeJunkData   
)

Definition at line 260 of file OpenSSLCertUtilsTest.cpp.

References folly::ssl::OpenSSLCertUtils::derDecode(), and EXPECT_THROW.

260  {
261  StringPiece junk{"MyFakeCertificate"};
262  EXPECT_THROW(
263  folly::ssl::OpenSSLCertUtils::derDecode(junk), std::runtime_error);
264 }
#define EXPECT_THROW(statement, expected_exception)
Definition: gtest.h:1843
static X509UniquePtr derDecode(ByteRange)
TEST_P ( OpenSSLCertUtilsTest  ,
TestDerDecodeTooShort   
)

Definition at line 266 of file OpenSSLCertUtilsTest.cpp.

References folly::ssl::OpenSSLCertUtils::derDecode(), folly::ssl::OpenSSLCertUtils::derEncode(), EXPECT_THROW, kTestCertWithSan, and readCertFromData().

266  {
267  auto x509 = readCertFromData(kTestCertWithSan);
268 
269  auto der = folly::ssl::OpenSSLCertUtils::derEncode(*x509);
270  der->trimEnd(1);
271  EXPECT_THROW(
273  std::runtime_error);
274 }
#define EXPECT_THROW(statement, expected_exception)
Definition: gtest.h:1843
const std::string kTestCertWithSan
static X509UniquePtr derDecode(ByteRange)
static folly::ssl::X509UniquePtr readCertFromData(const folly::StringPiece data)
static std::unique_ptr< IOBuf > derEncode(X509 &)
TEST_P ( OpenSSLCertUtilsTest  ,
TestReadCertsFromBuffer   
)

Definition at line 276 of file OpenSSLCertUtilsTest.cpp.

References kTestCertBundle, folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), and validateTestCertBundle().

276  {
279  validateTestCertBundle(certs);
280 }
const std::string kTestCertBundle
static void validateTestCertBundle(const std::vector< folly::ssl::X509UniquePtr > &certs)
static std::vector< X509UniquePtr > readCertsFromBuffer(ByteRange range)
Range< const char * > StringPiece
TEST_P ( OpenSSLCertUtilsTest  ,
TestReadCertsFromMixedBuffer   
)

Definition at line 284 of file OpenSSLCertUtilsTest.cpp.

References ASSERT_EQ, kTestCertWithSan, kTestKey, folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), and validateTestCertWithSAN().

284  {
285  std::vector<std::string> bufs(
286  {folly::to<std::string>(kTestCertWithSan, "\n\n", kTestKey, "\n"),
287  folly::to<std::string>(kTestKey, "\n\n", kTestCertWithSan, "\n")});
288  for (auto& buf : bufs) {
290  folly::StringPiece(buf));
291  ASSERT_EQ(1, certs.size());
292  validateTestCertWithSAN(certs.front().get());
293  }
294 }
static void validateTestCertWithSAN(X509 *x509)
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
const std::string kTestCertWithSan
const std::string kTestKey
static std::vector< X509UniquePtr > readCertsFromBuffer(ByteRange range)
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509Digest   
)

Definition at line 296 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getDigestSha1(), folly::ssl::OpenSSLCertUtils::getDigestSha256(), folly::hexlify(), kTestCertWithoutSan, folly::range(), and readCertFromFile().

296  {
298  EXPECT_NE(x509, nullptr);
299 
300  auto sha1Digest = folly::ssl::OpenSSLCertUtils::getDigestSha1(*x509);
301  EXPECT_EQ(
302  folly::hexlify(folly::range(sha1Digest)),
303  "b84e951d6c4e6cc70346357fab43d7ed73a07b0f");
304 
305  auto sha2Digest = folly::ssl::OpenSSLCertUtils::getDigestSha256(*x509);
306  EXPECT_EQ(
307  folly::hexlify(folly::range(sha2Digest)),
308  "364d3a6a0b10d0635ce59b40c0b7f505ab2cd9fd0a06661cdc61d9cb8c9c9821");
309 }
static std::array< uint8_t, SHA_DIGEST_LENGTH > getDigestSha1(X509 &x509)
static std::array< uint8_t, SHA256_DIGEST_LENGTH > getDigestSha256(X509 &x509)
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const char * kTestCertWithoutSan
static folly::ssl::X509UniquePtr readCertFromFile(const std::string &filename)
constexpr Range< Iter > range(Iter first, Iter last)
Definition: Range.h:1114
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
bool hexlify(const InputString &input, OutputString &output, bool append_output)
Definition: String-inl.h:596
TEST_P ( OpenSSLCertUtilsTest  ,
TestX509Store   
)

Definition at line 311 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, kTestCa, kTestCertWithoutSan, readCertFromFile(), and folly::ssl::OpenSSLCertUtils::readStoreFromFile().

311  {
313  EXPECT_NE(store, nullptr);
314 
316  folly::ssl::X509StoreCtxUniquePtr ctx(X509_STORE_CTX_new());
317  auto rc = X509_STORE_CTX_init(ctx.get(), store.get(), x509.get(), nullptr);
318  EXPECT_EQ(rc, 1);
319  rc = X509_verify_cert(ctx.get());
320  EXPECT_EQ(rc, 1);
321 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
const char * kTestCertWithoutSan
static folly::ssl::X509UniquePtr readCertFromFile(const std::string &filename)
static X509StoreUniquePtr readStoreFromFile(std::string caFile)
const char * kTestCa
std::unique_ptr< X509_STORE_CTX, X509StoreCtxDeleter > X509StoreCtxUniquePtr
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
TEST_P ( OpenSSLCertUtilsTest  ,
TestProcessMalformedCertBuf   
)

Definition at line 323 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_THROW, kTestCertBundle, folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), folly::ssl::OpenSSLCertUtils::readStoreFromBuffer(), and string.

323  {
324  std::string badCert =
325  "-----BEGIN CERTIFICATE-----\n"
326  "yo\n"
327  "-----END CERTIFICATE-----\n";
328 
329  EXPECT_THROW(
331  folly::StringPiece(badCert)),
332  std::runtime_error);
333 
334  EXPECT_THROW(
336  folly::StringPiece(badCert)),
337  std::runtime_error);
338 
339  std::string bufWithBadCert =
340  folly::to<std::string>(badCert, "\n", kTestCertBundle);
341 
342  EXPECT_THROW(
344  folly::StringPiece(bufWithBadCert)),
345  std::runtime_error);
346 
347  EXPECT_THROW(
349  folly::StringPiece(bufWithBadCert)),
350  std::runtime_error);
351 }
#define EXPECT_THROW(statement, expected_exception)
Definition: gtest.h:1843
static X509StoreUniquePtr readStoreFromBuffer(ByteRange range)
const std::string kTestCertBundle
const char * string
Definition: Conv.cpp:212
static std::vector< X509UniquePtr > readCertsFromBuffer(ByteRange range)
TEST_P ( OpenSSLCertUtilsTest  ,
TestReadStoreDuplicate   
)

Definition at line 353 of file OpenSSLCertUtilsTest.cpp.

References EXPECT_EQ, EXPECT_NE, kTestCertBundle, and folly::ssl::OpenSSLCertUtils::readStoreFromBuffer().

353  {
354  auto dupBundle =
355  folly::to<std::string>(kTestCertBundle, "\n\n", kTestCertBundle);
356 
358  folly::StringPiece(dupBundle));
359  EXPECT_NE(store, nullptr);
360  EXPECT_EQ(ERR_get_error(), 0);
361 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static X509StoreUniquePtr readStoreFromBuffer(ByteRange range)
const std::string kTestCertBundle
#define EXPECT_NE(val1, val2)
Definition: gtest.h:1926
static void validateTestCertBundle ( const std::vector< folly::ssl::X509UniquePtr > &  certs)
static

Definition at line 168 of file OpenSSLCertUtilsTest.cpp.

References folly::enumerate(), EXPECT_EQ, EXPECT_TRUE, folly::ssl::OpenSSLCertUtils::getCommonName(), i, and folly::sformat().

Referenced by TEST_P().

169  {
170  EXPECT_EQ(certs.size(), 3);
171  for (auto i : folly::enumerate(certs)) {
173  EXPECT_TRUE(identity);
174  EXPECT_EQ(*identity, folly::sformat("test cert {}", i.index + 1));
175  }
176 }
std::string sformat(StringPiece fmt, Args &&...args)
Definition: Format.h:280
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static Optional< std::string > getCommonName(X509 &x509)
detail::RangeEnumerator< Range > enumerate(Range &&r)
Definition: Enumerate.h:167
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
static void validateTestCertWithSAN ( X509 *  x509)
static

Definition at line 179 of file OpenSSLCertUtilsTest.cpp.

References ASSERT_NE, EXPECT_EQ, folly::ssl::OpenSSLCertUtils::getCommonName(), and folly::ssl::OpenSSLCertUtils::getSubjectAltNames().

Referenced by TEST_P().

179  {
180  ASSERT_NE(nullptr, x509);
181  auto identity = folly::ssl::OpenSSLCertUtils::getCommonName(*x509);
182  EXPECT_EQ("127.0.0.1", identity.value());
184  EXPECT_EQ(2, altNames.size());
185  EXPECT_EQ("anotherexample.com", altNames[0]);
186  EXPECT_EQ("*.thirdexample.com", altNames[1]);
187 }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
static std::vector< std::string > getSubjectAltNames(X509 &x509)
static Optional< std::string > getCommonName(X509 &x509)
#define ASSERT_NE(val1, val2)
Definition: gtest.h:1960

Variable Documentation

const char* kTestCa = "folly/io/async/test/certs/ca-cert.pem"

Definition at line 31 of file OpenSSLCertUtilsTest.cpp.

Referenced by TEST_P().

const std::string kTestCertBundle

Definition at line 64 of file OpenSSLCertUtilsTest.cpp.

Referenced by TEST_P().

const char* kTestCertWithoutSan = "folly/io/async/test/certs/tests-cert.pem"

Definition at line 30 of file OpenSSLCertUtilsTest.cpp.

Referenced by TEST_P().

const std::string kTestCertWithSan
Initial value:
-----BEGIN CERTIFICATE-----
MIIDXDCCAkSgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBQMQswCQYDVQQGEwJVUzEL
MAkGA1UECAwCQ0ExDTALBgNVBAoMBEFzb3gxJTAjBgNVBAMMHEFzb3ggQ2VydGlm
aWNhdGlvbiBBdXRob3JpdHkwHhcNMTcwMjEzMjMyMTAzWhcNNDQwNzAxMjMyMTAz
WjAwMQswCQYDVQQGEwJVUzENMAsGA1UECgwEQXNveDESMBAGA1UEAwwJMTI3LjAu
MC4xMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7/f4YYOYunAM/VkmjDYDg3AW
UgyyTIraWmmQZsnu0bYNV/lLLfNzCtHggxGSwEtEe40nNb9C8wQmHUvb7VBBl6OC
ASowggEmMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh
dGVkIENlcnRpZmljYXRlMB0GA1UdDgQWBBRx1kmdZEfXHmWLHpSDI0Lh8hmfwzAf
BgNVHSMEGDAWgBQX3ykJKb97nxp/6UZJyDvts7noezAxBgNVHREEKjAoghJhbm90
aGVyZXhhbXBsZS5jb22CEioudGhpcmRleGFtcGxlLmNvbTB4BggrBgEFBQcBAQRs
MGowaAYIKwYBBQUHMAKGXGh0dHBzOi8vcGhhYnJpY2F0b3IuZmIuY29tL2RpZmZ1
c2lvbi9GQkNPREUvYnJvd3NlL21hc3Rlci90aS90ZXN0X2NlcnRzL2NhX2NlcnQu
cGVtP3ZpZXc9cmF3MA0GCSqGSIb3DQEBCwUAA4IBAQCj3FLjLMLudaFDiYo9pAPQ
NBYNpG27aajQCvnEsYaMAGnNBxUUhv/E4xpnJEhatiCJWlPgGebdjXkpXYkLxnFj
38UmpfZbNcvPPKxXmjIlkpYeFwcHTAUpFmMXVHdr8FjkDSN+qWHLllMFNAAqp0U6
4VWjDlq9xCjzNw+8fdcEpwylpPrbNyQHqSO1k+DhM2qPuQfiWPmHe2PbJv8JB3no
HWGi9SNe0FjtJM3066L0Gj8g/bFDo/pnyKguQyGkS7PaepK5/u5Y2fMMBO/m4+U0
b9Yb0TvatsqL688CoZcSn73A0yAjptwbD/4HmcVlG2j/y8eTVpXisugu6Xz+QQGu
-----END CERTIFICATE-----
)")
std::string stripLeftMargin(std::string s)
Definition: String.cpp:704

Definition at line 41 of file OpenSSLCertUtilsTest.cpp.

Referenced by TEST_P().

const std::string kTestKey
Initial value:
----BEGIN EC PRIVATE KEY-----
MHcCAQEEIBskFwVZ9miFN+SKCFZPe9WEuFGmP+fsecLUnsTN6bOcoAoGCCqGSM49
AwEHoUQDQgAE7/f4YYOYunAM/VkmjDYDg3AWUgyyTIraWmmQZsnu0bYNV/lLLfNz
CtHggxGSwEtEe40nNb9C8wQmHUvb7VBBlw==
-----END EC PRIVATE KEY-----
)")
std::string stripLeftMargin(std::string s)
Definition: String.cpp:704

Definition at line 34 of file OpenSSLCertUtilsTest.cpp.

Referenced by folly::getctx(), folly::TEST(), and TEST_P().