Home | History | Annotate | Download | only in util

Lines Matching refs:x509

25 // Tests reading an X509 certificate from a PEM encoded string.
41 X509* x509 = CertificateUtil::X509FromPEM(pem);
43 if (!x509) {
47 ASSERT_TRUE(x509);
48 X509_free(x509);
51 // Tests converting an X509 certificate to a PEM encoded string.
53 X509* x509 = X509_new();
78 X509_set_version(x509, 2);
79 ASN1_INTEGER_set(X509_get_serialNumber(x509), 0);
80 ASN1_TIME_set(X509_get_notBefore(x509), 0);
81 ASN1_TIME_set(X509_get_notAfter(x509), 60*60*24*365);
82 X509_set_pubkey(x509, pkey);
83 X509_NAME* name = X509_get_subject_name(x509);
91 X509_set_issuer_name(x509, name);
92 X509_sign(x509, pkey, EVP_sha256());
94 std::string pem = CertificateUtil::X509ToPEM(x509);
96 X509_free(x509);
176 X509* x509 = CertificateUtil::GenerateSelfSignedCert(pkey, "test", 365);
177 ASSERT_TRUE(x509);
180 X509_free(x509);